i3wangyi commented on a change in pull request #688: Fix the watcher leakage
issue
URL: https://github.com/apache/helix/pull/688#discussion_r376022376
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
##########
@@ -960,10 +956,10 @@ public void process(WatchedEvent event) {
private void fireAllEvents() {
for (Entry<String, Set<IZkChildListener>> entry :
_childListener.entrySet()) {
- fireChildChangedEvents(entry.getKey(), entry.getValue());
+ fireChildChangedEvents(entry.getKey(), entry.getValue(), true);
Review comment:
Good question. I think with the default value, it will reinstall the watcher
whatever left on the previous session; It's likely the node deletion happens
after session expiry, in this case, it will leak; One mitigation approach is to
perform EXISTS check when handling new session, but it's always possible a
race-condition exists (that the node deletion happen after the exists check).
One good thing though comes with new session is that all the "leaked" watchers
will be gone.
Do you think a set of exists check on each path from original session should
be performed or it's OK to trade-off between performance and excessive watchers.
----------------------------------------------------------------
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]