curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: Leader latch issue?
Date Thu, 29 May 2014 00:56:13 GMT
I’d like to see this fixed globally where needed. A suggestion is to add a method to the
ConnectionState enum something like isConnectedState() so RECONNECTED and CONNECTED can return
true. Then, throughout Curator it can check that value.

-JZ


From: Cameron McKenzie mckenzie.cam@gmail.com
Reply: user@curator.apache.org user@curator.apache.org
Date: May 28, 2014 at 5:58:09 PM
To: user@curator.apache.org user@curator.apache.org
Subject:  Leader latch issue?  

Guys,
I'm having a small issue with the LeaderLatch recipe, which I can probably work around, but
I thought I'd check if it's considered an issue worth fixing.

If we start a LeaderLatch and no connection to ZooKeeper is available, then when a connection
does become available to ZooKeeper, the latch does not start. This is because in the handleStateChange()
method, it only resets the latch state on RECONNECTED, not on CONNECTED.

So, the latch can recover from connection loss if it's previously had a connection, but not
if it's never had a connection.

I presume this would simply be a case of changing the handleStateChange() method to handle
the CONNECTED case as well. I've had a quick look and I don't think this would have any side
effects.

I'm happy to fix the issue if this is considered a reasonable solution.
cheers
Cam
Mime
View raw message