Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/5879#discussion_r183981216
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalService.java
---
@@ -100,6 +100,12 @@ public void start(LeaderRetrievalListener listener)
throws Exception {
LOG.info("Starting ZooKeeperLeaderRetrievalService {}.",
retrievalPath);
synchronized (lock) {
+ // A double check for the race condition that multi
invocation on this method
+ // could pass the first checkState() and wait on the
lock, then they can all reset
+ // the leaderListener.
+ Preconditions.checkState(leaderListener == null,
"ZooKeeperLeaderRetrievalService can " +
--- End diff --
eh it's fine. I missed that it was in a separate commit.
---