You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/04/02 03:16:49 UTC

[GitHub] [helix] lei-xia commented on a change in pull request #924: WIP: fix ZkHelixPropertyStore loses Zookeeper notification issue

lei-xia commented on a change in pull request #924: WIP: fix ZkHelixPropertyStore loses Zookeeper notification issue
URL: https://github.com/apache/helix/pull/924#discussion_r402028968
 
 

 ##########
 File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
 ##########
 @@ -1073,10 +1073,24 @@ protected void processStateChanged(WatchedEvent event) {
 
     fireStateChangedEvent(event.getState());
 
+    // This following is the case for ZkClient no managing connection
     if (!isManagingZkConnection()) {
+      /*
+       * For SharedZkClient, we will not invoke fireNewSessionEvents but will invoke fireAllEvents
+       * This keeps the same behavior as original SharedZkClient.
+       * Invoking fireAllEvents is important to make sure HelixPropertyStore working correctly.
+       */
+      if ((event.getState() == KeeperState.SyncConnected) && (!_isNewSessionEventFired) && (!"0"
+          .equals(getHexSessionId()))) {
+        fireAllEvents();
+        _isNewSessionEventFired = true;
+      } else if (event.getState() == KeeperState.Expired) {
+        _isNewSessionEventFired = false;
+      }
       return;
     }
 
+    // The following is the case for ZkClient managing the connection
 
 Review comment:
   This comment is a bit confusing.  You mean "The following only applies to dedicated ZkClient in which it manages ZkConnection directly", right?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org