pkuwm commented on a change in pull request #1109:
URL: https://github.com/apache/helix/pull/1109#discussion_r459104568



##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -2216,4 +2253,25 @@ private void validateCurrentThread() {
       throw new IllegalArgumentException("Must not be done in the zookeeper 
event thread.");
     }
   }
+
+  private void checkNumChildren(String path) throws KeeperException, 
InterruptedException {
+    Stat stat = ((ZkConnection) getConnection()).getZookeeper().exists(path, 
false);

Review comment:
       @jiajunwang Good catch! I used to call `getStat()` considering 
reconnect. By somehow I changed it to `exists()` which is not supposed to. I 
believe `getStat()` is what we need: wait until connected and monitoring. 
Regarding nested retry until connected, it is fine because if getStat keeps 
getting connection loss and retrying, even we don't use getStat(), it'll be 
retrying as well in getChildren. 
   Reverted to `getStat()`




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



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

Reply via email to