Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedMay 9, 2022
edited
Loading

Fixes#92530.

@serhiy-storchakaserhiy-storchaka added type-bugAn unexpected behavior, bug, or error needs backport to 3.9 needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsMay 9, 2022
@serhiy-storchakaserhiy-storchaka linked an issueMay 9, 2022 that may beclosed by this pull request
Copy link
Contributor

@hauntsaninjahauntsaninja left a 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

@serhiy-storchaka
Copy link
MemberAuthor

No,self._waiters is still a deque.

@miss-islington
Copy link
Contributor

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11.
🐍🍒⛏🤖

@serhiy-storchakaserhiy-storchaka deleted the threading-condition-notify-interrupt branchMay 16, 2022 05:25
@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelMay 16, 2022
@bedevere-bot
Copy link

GH-92829 is a backport of this pull request to the3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 16, 2022
…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>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 16, 2022
…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-botbedevere-bot removed the needs backport to 3.10only security fixes labelMay 16, 2022
@bedevere-bot
Copy link

GH-92830 is a backport of this pull request to the3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 16, 2022
…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
Copy link

GH-92831 is a backport of this pull request to the3.9 branch.

@vstinner
Copy link
Member

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 :-)

@serhiy-storchaka
Copy link
MemberAuthor

EAFP is so superior to LBYL here, that the latter I did not even consider.

ambv pushed a commit that referenced this pull requestMay 16, 2022
…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>
ambv pushed a commit that referenced this pull requestMay 16, 2022
…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>
miss-islington added a commit that referenced this pull requestMay 17, 2022
…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
hello-adam pushed a commit to hello-adam/cpython that referenced this pull requestJun 2, 2022
…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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja left review comments

@methanemethanemethane approved these changes

@vstinnervstinnerAwaiting requested review from vstinner

@pitroupitrouAwaiting requested review from pitrou

Assignees

No one assigned

Labels

type-bugAn unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Issues when Condition.notify() is interrupted

6 participants

@serhiy-storchaka@miss-islington@bedevere-bot@vstinner@methane@hauntsaninja

[8]ページ先頭

©2009-2025 Movatter.jp