kaisun2000 commented on a change in pull request #924: Fix ZkHelixPropertyStore 
loses Zookeeper notification issue
URL: https://github.com/apache/helix/pull/924#discussion_r406389934
 
 

 ##########
 File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
 ##########
 @@ -1080,22 +1080,21 @@ protected void processStateChanged(WatchedEvent event) 
{
      */
     if (event.getState() == KeeperState.SyncConnected) {
       if (!_isNewSessionEventFired && !"0".equals(getHexSessionId())) {
-        if (isManagingZkConnection()) {
-          /*
-           * 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();
-        }
         /*
          * Set it true to avoid firing events again for the same session next 
time
          * when SyncConnected events are received.
          */
         _isNewSessionEventFired = true;
 
+        /*
+         * 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();
 
 Review comment:
   I changed it back to the original way. The previous changing order should 
also work. But to be on the safe side, as you commented, let us change it back 
to original way.

----------------------------------------------------------------
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