docker / libkv

Distributed key/value store abstraction library
Apache License 2.0
853 stars 205 forks source link

Zookeeper: Relinquish locks on session close #156

Open convergentio opened 7 years ago

convergentio commented 7 years ago

The zookeeper store implements locking by using ephermeral nodes. On session close, all ephemeral nodes created by a client are removed, which means that other clients can acquire the lock.

Previously, the zookeeper store failed to notify clients that the lock had been relinquished due to the session being closed (due to expiration or otherwise). Which means that the clients would continue execution while believing (wrongfully) that they still hold the lock.

Now, the zookeeper store monitors the state of the session and notifies clients that the lock has been lost when the session is closed.

Signed-off-by: Daniel Ferstay dan@cohodata.com

convergentio commented 7 years ago

The CI failure is fixed by https://github.com/docker/libkv/pull/154