kezhuw commented on code in PR #2058: URL: https://github.com/apache/zookeeper/pull/2058#discussion_r1769476369
########## zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java: ########## @@ -1274,7 +1295,6 @@ private void cleanAndNotifyState() { eventThread.queueEvent(new WatchedEvent(Event.EventType.None, Event.KeeperState.Disconnected, null)); } clientCnxnSocket.updateNow(); - clientCnxnSocket.updateLastSendAndHeard(); Review Comment: Because we are not sending nor receiving anything in disconnection. And, session expiration timeout is calculating base on `lastHeard`. If we are going to update it, we will never hit `SessionTimeoutException`. Besides, `updateLastSendAndHeard` updates both `lastSend` and `lastHeard`. It should be only called for newly established connection. That is one per connection. 1. NIO: https://github.com/apache/zookeeper/blob/bc9afbf8ef1bc6156643d3d05c87fcf8411e9d8f/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNIO.java#L344-L348 2. Netty: https://github.com/apache/zookeeper/blob/bc9afbf8ef1bc6156643d3d05c87fcf8411e9d8f/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java#L166-L168 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org