Github user timothyjward commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/529#discussion_r196090467 --- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java --- @@ -1260,10 +1260,8 @@ public void run() { cleanup(); } clientCnxnSocket.close(); - if (state.isAlive()) { - eventThread.queueEvent(new WatchedEvent(Event.EventType.None, - Event.KeeperState.Disconnected, null)); - } + eventThread.queueEvent(new WatchedEvent(Event.EventType.None, + Event.KeeperState.Closed, null)); --- End diff -- Good catch - in the previous version of this patch the terminal event re-used the disconnected state for closing (hence removing the if check. Now that we have a Closed event the Disconnected event should still be sent if the client is connected at the time of the close.
---