I am using celery and zookeeper (kazoo lock) to lock my workers. I have a problem when I kill (-9) one of the workers before releasing the lock then that lock stays locked forever.
So my question is: Does killing the process release locks in that process or is this some bug in zookeeper?
Zookeeper locks use ephemeral nodes. An ephemeral node is a node that lives as long as the session that created it is alive. Sessions are kept alive by the process creating the session periodically sending a heartbeat message to zookeeper.
So if you kill the process that created the lock, the lock will eventually be released, as the session will die as zookeeper no longer receives heartbeats.
So killing a worker before the lock is released should eventually release the lock.
If the lock is never released, a couple things could be happening,
It is very unlikely this is a zookeeper bug.
How do you know the lock is not being released?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With