You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2024/11/03 05:45:28 UTC
Re: [PR] CURATOR-710: Fix leaking watch in EnsembleTracker [curator]
tisonkun commented on code in PR #508:
URL: https://github.com/apache/curator/pull/508#discussion_r1826908878
##########
curator-framework/src/main/java/org/apache/curator/framework/imps/Watching.java:
##########
@@ -28,36 +28,46 @@ public class Watching {
private final CuratorWatcher curatorWatcher;
private final boolean watched;
private final CuratorFrameworkImpl client;
+ private WatcherRemovalManager watcherRemovalManager;
private NamespaceWatcher namespaceWatcher;
public Watching(CuratorFrameworkImpl client, boolean watched) {
this.client = client;
+ this.watcherRemovalManager = client.getWatcherRemovalManager();
this.watcher = null;
this.curatorWatcher = null;
this.watched = watched;
}
public Watching(CuratorFrameworkImpl client, Watcher watcher) {
this.client = client;
+ this.watcherRemovalManager = client.getWatcherRemovalManager();
this.watcher = watcher;
this.curatorWatcher = null;
this.watched = false;
}
public Watching(CuratorFrameworkImpl client, CuratorWatcher watcher) {
this.client = client;
+ this.watcherRemovalManager = client.getWatcherRemovalManager();
this.watcher = null;
this.curatorWatcher = watcher;
this.watched = false;
}
public Watching(CuratorFrameworkImpl client) {
this.client = client;
+ this.watcherRemovalManager = client.getWatcherRemovalManager();
watcher = null;
watched = false;
curatorWatcher = null;
}
+ Watching setWatcherRemovalManager(WatcherRemovalManager watcherRemovalManager) {
+ this.watcherRemovalManager = watcherRemovalManager;
+ return this;
+ }
Review Comment:
It seems the `watcherRemovalManager` already set in the constructor by `this.watcherRemovalManager = client.getWatcherRemovalManager();`?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org