[ https://issues.apache.org/jira/browse/CURATOR-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16940400#comment-16940400 ]
Shay Shimony commented on CURATOR-544: -------------------------------------- Thanks :) Isn't disabling the automated ZooKeeper handle replacement, that will be implemented in this Jira, essentially similar to option 2 in that email from 9/20? I will paste below the part I refer to: "The second is still rough. Basically it relies on session expire mechanism in ZK. We will adopt the unoptimized version in the recipe[2] given that in our scenario there are only few contenders at the same time. Thus we create /leader node as ephemeral znode with leader information and when session expired we think leadership is revoked and terminate the contender. Asynchronous write operations should not succeed because they will all fail on session expire." After having this Jira implemented, won't you be able to get what you wanted in that email? "**Writes on ZK must be committed only if the contender is the leader**" Because a leader will be able to try to create new ZK only upon receiving a call to LeaderLatch.notLeader(). > Implement SessionConnectionHandlingPolicy > ----------------------------------------- > > Key: CURATOR-544 > URL: https://issues.apache.org/jira/browse/CURATOR-544 > Project: Apache Curator > Issue Type: New Feature > Components: Client > Reporter: Zili Chen > Priority: Major > > https://lists.apache.org/x/thread.html/2549c310c1e3232d2f746bf1cf7110c094ea2ca9d1e54b34b75a508f@%3Cuser.curator.apache.org%3E > Currently Curator will always reset on session expire and instance a new ZK > client as well as recover state. > Because on session expire ephemeral znodes get deleted, some of user cases > possibly want to manually handle session expire before automatically reset > {{o.a.c.ConnectionState}}. > I propose implement a {{SessionConnectionHandlingPolicy}} whose > {{callWithRetry}} use {{SessionFailRetryLoop}} so that > {{o.a.c.ConnectionState}} fails on session expired. > BTW, it would be a user-friendly way to make user of {{SessionFailRetryLoop}}. > I volunteer to work on an implementation. > What do you think? > CC [~randgalt] -- This message was sent by Atlassian Jira (v8.3.4#803005)