Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2126

Improve exit log messsage of EventThread and SendThread by adding SessionId

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.4.7, 3.5.1, 3.6.0
    • java client
    • None

    Description

      We saw the following out of order log when close Zookeeper client session.

      2015-02-16 06:01:12,985 INFO org.apache.zookeeper.ZooKeeper: Session: 0x24b8df4044005d4 closed
      .....................................
      2015-02-16 06:01:12,995 INFO org.apache.zookeeper.ClientCnxn: EventThread shut down
      

      This logs are very confusing if a new Zookeeper client session is created between these two logs. We may think new Zookeeper client session shutdown it EventThread instead of the old closed Zookeeper client session.

      Should we wait for sendThread and eventThread died in the ClientCnxn.close?
      We can add the following code in ClientCnxn.close.

      sendThread.join(timeout);
      eventThread.join(timeout);
      

      with the change, we won't interleave old closed session with new session.
      We can also create a new close API to support this so we won't affect the old code if people use old close API.

      Attachments

        1. ZOOKEEPER-2126_1.patch
          1 kB
          Surendra Singh Lilhore
        2. ZOOKEEPER-2126_2.patch
          1 kB
          Surendra Singh Lilhore
        3. ZOOKEEPER-2126.patch
          0.7 kB
          Surendra Singh Lilhore

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            surendralilhore Surendra Singh Lilhore
            zxu Zhihai Xu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment