KarmaGYZ commented on code in PR #23773:
URL: https://github.com/apache/flink/pull/23773#discussion_r1403065234
##########
flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java:
##########
@@ -69,8 +68,40 @@ public class ZooKeeperLeaderRetrievalDriver implements
LeaderRetrievalDriver {
private final FatalErrorHandler fatalErrorHandler;
+ /**
+ * Each {@code ZooKeeperLeaderRetrievalDriver} has its own watcher
initialized. There is a bug
Review Comment:
I think the core issue is a specific component should take the
responsibility to manage the lifecycle of watches. This component can be
ZooKeeper, Curator, or Flink. ZK can provide a "closeWatch" interface to
reconcile watch references on the server-side. Similarly, Curator and Flink can
proactively handle this task and clean up by using "closeAll," just like what
you did in this PR.
I personally believe that let ZK to handle this task is more reasonable.
However, considering the release cycles of ZK and the need to maintain
compatibility with multiple versions of ZK in Flink, we may need to proactively
manage the lifecycle of watches within Flink in the foreseeable future.
--
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]