-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock with read/write lock recipe #649
Comments
westphahl
added a commit
to westphahl/kazoo
that referenced
this issue
Jul 31, 2021
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in python-zk#649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Fixes: python-zk#649
westphahl
added a commit
to westphahl/kazoo
that referenced
this issue
Aug 2, 2021
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in python-zk#649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes python-zk#649
westphahl
added a commit
to westphahl/kazoo
that referenced
this issue
Aug 2, 2021
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in python-zk#649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes python-zk#649
westphahl
added a commit
to westphahl/kazoo
that referenced
this issue
Feb 1, 2022
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in python-zk#649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes python-zk#649
StephenSorriaux
pushed a commit
to westphahl/kazoo
that referenced
this issue
Feb 3, 2022
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in python-zk#649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes python-zk#649
StephenSorriaux
pushed a commit
that referenced
this issue
Feb 7, 2022
The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in #649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes #649
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
Read/write lock recipe never deadlocks.
Actual Behavior
Read/write lock recipe deadlocks under certain conditions. The deadlock seems to happen as follows:
We now have a deadlock with the read lock and the second write lock waiting for each other to be "released".
There can be a variation of this when the second write lock's znode is created before the read lock calls:
kazoo/kazoo/recipe/lock.py
Line 263 in 6337fd6
This will lead to the same deadlock condition with the read and the second write lock watching each other independent of the currently acquired write lock.
Snippet to Reproduce the Problem
Logs with logging in DEBUG mode
Specifications
pip list
command:The text was updated successfully, but these errors were encountered: