XComp commented on code in PR #23773:
URL: https://github.com/apache/flink/pull/23773#discussion_r1403018967
##########
flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java:
##########
@@ -126,17 +161,13 @@ public void close() throws Exception {
cache.close();
- try {
- if (client.getZookeeperClient().isConnected()
- &&
!connectionInformationPath.contains(RESOURCE_MANAGER_NODE)) {
- client.watchers()
- .removeAll()
- .ofType(Watcher.WatcherType.Any)
- .forPath(connectionInformationPath);
- }
- } catch (KeeperException.NoWatcherException e) {
- // Ignore the no watcher exception as it's just a safetynet to fix
watcher leak issue.
- // For more details, please refer to FLINK-33053.
+ if (client.getZookeeperClient().isConnected()
+ && watcherReferenceCounter.getAndIncrement() == 1) {
Review Comment:
yikes, I introduced that one when I did another code change. Good catch :+1:
That proofs once more that a proper test should be added to cover this code
path. :thinking:
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]