kazoo icon indicating copy to clipboard operation
kazoo copied to clipboard

Calls to Lock.acquire hang after lost connection is recovered

Open michaelbironneau opened this issue 10 years ago • 1 comments

I am using the Lock recipe and am having trouble recovering from lost connections to Zookeeper as any call to acquire_lock after the connection is recovered hangs.

The steps I follow are: I create and acquire a lock using Lock(...).acquire() and use add_listener to keep tabs on the connection state. I then simulate a connection loss by CTRL+C'ing Zookeeper and then restarting it. After the connection drops and then recovers, the state goes back to CONNECTED, and I attempt to reacquire the lock using acquire. However, this last call always hangs. I'm doing this on Windows, if that makes any difference.

Is that the expected behavior, and if so, what is the correct way to try and reacquire the lock?

Thanks

michaelbironneau avatar Feb 19 '15 09:02 michaelbironneau

This kind of behavior seems like it should work, and is probably a bug, it would seem the lock should either reacquire itself or you should be able to cause it to recover manually.

harlowja avatar May 12 '15 17:05 harlowja