-
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
fix(recipe): fix deadlock in r/w lock recipe #650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test case for #649?
Done. |
Thank you, I will first fix the CI since travis-ci.org has ceased and then take a look at your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me from a code perspective. I haven't used this lock recipe at all, so afraid I can't comment on the design change. But your explanation seems lucid/makes sense.
f9d1624
to
37d3da5
Compare
@StephenSorriaux I rebased the fix in order to have the CI jobs running. |
Codecov Report
@@ Coverage Diff @@
## master #650 +/- ##
==========================================
+ Coverage 94.44% 94.49% +0.04%
==========================================
Files 57 57
Lines 8342 8375 +33
==========================================
+ Hits 7879 7914 +35
+ Misses 463 461 -2
Continue to review full report at Codecov.
|
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
37d3da5
to
884cac3
Compare
Mh seems like Codecov has some trouble... Will retry the jobs tomorow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this.
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.
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.
Closes #649