Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify#92534
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify#92534
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ng.Condition.notify
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.
Removing the deque entirely undoes the optimisation fromhttps://bugs.python.org/issue17385
No, |
Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11. |
bedevere-bot commentedMay 16, 2022
GH-92829 is a backport of this pull request to the3.11 branch. |
…ng.Condition.notify (pythonGH-92534)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ng.Condition.notify (pythonGH-92534)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
bedevere-bot commentedMay 16, 2022
GH-92830 is a backport of this pull request to the3.10 branch. |
…ng.Condition.notify (pythonGH-92534)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
bedevere-bot commentedMay 16, 2022
GH-92831 is a backport of this pull request to the3.9 branch. |
I reviewed your fix twice. Ok, now it makes sense and the comment is enough to explain the fix and the code. It might be safe to check if the waiter is already released by calling the .locked() method, but I don't think that it's worth it and it might introduce new subtle concurrency issues. In short, the fix is correct :-) |
EAFP is so superior to LBYL here, that the latter I did not even consider. |
…dition.notify (GH-92534) (GH-92831)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…dition.notify (GH-92534) (GH-92830)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ing.Condition.notify (GH-92534) (GH-92829)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Automerge-Triggered-By: GH:serhiy-storchaka
…ng.Condition.notify (pythonGH-92534) (pythonGH-92831)If Condition.notify() was interrupted just after it released the waiter lock,but before removing it from the queue, the following calls of notify() failedwith RuntimeError: cannot release un-acquired lock.(cherry picked from commit70af994)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Fixes#92530.