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

Prevent certain state transitions in Java client on close(); improve exception handling and enhance client testability

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.6.0
    • Component/s: java client
    • Labels:
      None
    • Tags:
      Java client

      Description

      ZooKeeper.close() doesn't force the client into a CLOSED state. While the closing flag ensures that the client will close, its state may end up in CLOSED, CONNECTING or CONNECTED.
      I developed a patch and in the process cleaned up a few other things primarily to enable testing of state transitions.

      • ClientCnxnState is new and enforces certain state transitions
      • ZooKeeper.isExpired() is new
      • ClientCnxn no longer refers to ZooKeeper, WatchManager is externalized, and ClientWatchManager includes 3 new methods
      • The SendThread terminates the EventThread on a call to close() via the event-of-death
      • Polymorphism is used to handle internal exceptions (SendIOExceptions)
      • The patch incorporates ZOOKEEPER-126.patch and prevents close() from blocking

        Attachments

        1. ZOOKEEPER-1202.patch
          75 kB
          Matthias Spycher

          Issue Links

            Activity

              People

              • Assignee:
                mspycher Matthias Spycher
                Reporter:
                mspycher Matthias Spycher
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: