i3wangyi commented on a change in pull request #688: Fix the watcher leakage 
issue
URL: https://github.com/apache/helix/pull/688#discussion_r373695732
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
 ##########
 @@ -1309,22 +1306,24 @@ public void run() throws Exception {
     }
   }
 
-  private void fireChildChangedEvents(final String path, Set<IZkChildListener> 
childListeners) {
+  private void fireChildChangedEvents(final String path, Set<IZkChildListener> 
childListeners, boolean pathExists) {
     try {
-      final ZkPathStatRecord pathStatRecord = new ZkPathStatRecord(path);
       for (final IZkChildListener listener : childListeners) {
         _eventThread.send(new ZkEvent("Children of " + path + " changed sent 
to " + listener) {
           @Override
           public void run() throws Exception {
-            // Reinstall watch before listener callbacks to check the znode 
status
-            if (!pathStatRecord.pathChecked()) {
 
 Review comment:
   I checked the code in `recordPathStat`, basically, the line 
`pathStatRecord.recordPathStat(getStat(path, hasListeners(path)), 
OptionalLong.empty());` does nothing! This is because notificationTime is 
optional.empty() and the propogation latency is never recorded when child 
change events. 
   
   I feel like leaving this piece of code here will just make ourselves 
confused. And if in the future, we do need to record propagation latency for 
child events. We could add it back. 
   
   Second, `getStat(path, hasListeners(path))` will add a exists watcher for 
the parent path (child listener). Don't we want to add watcher type of `child`? 
The code here looks problematic for me, please clarify the original purpose if 
I misunderstand it. Thanks!

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