tisonkun commented on code in PR #430: URL: https://github.com/apache/curator/pull/430#discussion_r967853023
########## curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java: ########## @@ -667,9 +670,9 @@ protected void handleStateChange(ConnectionState newState) { try { - if ( client.getConnectionStateErrorPolicy().isErrorState(ConnectionState.SUSPENDED) || !hasLeadership.get() ) Review Comment: If you take a look at FLINK-10052, the final solution is using a SessionErrorPolicy that will skip this `if` block. Since a ConnectionLoss may be only network unstable instead of the node lost its leadership (the ephemeral node). Before this patch it's `reset` to be called and actively give up the leadership, it will cause reelection, increase ZK workload and cause further inconsistency. The thorough solution should be something like I proposed in https://github.com/apache/flink/pull/9878, but I failed to contribute it to the upstream (FLINK-10052 takes more than 2 years to be merged. It's not a good experience to me, lol). We run with the solution in Tencent for years and it works well :) -- 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: dev-unsubscr...@curator.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org