pkuwm commented on a change in pull request #642: Fix handleNewSession creating 
ephemeral node with expired session
URL: https://github.com/apache/helix/pull/642#discussion_r361215801
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
 ##########
 @@ -886,19 +1141,20 @@ private void reconnect() {
   }
 
   private void fireNewSessionEvents() {
+    final String sessionId = getHexSessionId(getSessionId());
 
 Review comment:
   Added a double check before firing new session events.
   ```
       if (event.getState() == KeeperState.SyncConnected) {
         if (!_isNewSessionEventFired && !"0".equals(getHexSessionId())) {
           /*
            * Before the new zookeeper instance is connected to the zookeeper 
service and its session
            * is established, its session id is 0.
            * New session event is not fired until the new zookeeper session 
receives the first
            * SyncConnected state(the zookeeper session is established).
            * Now the session id is available and non-zero, and we can fire new 
session events.
            */
           fireNewSessionEvents();
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to