Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-87135: threading.Lock: Raise rather than hang on Python finalization#135991
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…lizationAfter Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock musthang.Raise PythonFinalizationError instead of hanging.
colesbury left a comment
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.
I think this approach makes sense. A comment about the flags below
Uh oh!
There was an error while loading.Please reload this page.
vstinner commentedJun 26, 2025
There is a suspicious error when running test.test_multiprocessing_spawn.test_processes: |
vstinner left a comment
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.
LGTM
fe119a0 intopython:mainUh oh!
There was an error while loading.Please reload this page.
…lization (pythonGH-135991)After Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock must hang.Raise PythonFinalizationError instead of hanging.
…lization (pythonGH-135991)After Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock must hang.Raise PythonFinalizationError instead of hanging.
…lization (pythonGH-135991)After Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock must hang.Raise PythonFinalizationError instead of hanging.
…lization (pythonGH-135991)After Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock must hang.Raise PythonFinalizationError instead of hanging.
…lization (pythonGH-135991)After Python finalization gets to the point where no other threadcan attach thread state, attempting to acquire a Python lock must hang.Raise PythonFinalizationError instead of hanging.
Uh oh!
There was an error while loading.Please reload this page.
After Python finalization gets to the point where no other thread can attach thread state, attempting to acquire a Python lock will hang.
Raise PythonFinalizationError instead of hanging.
@colesbury, does this look maintainable (and correct) to you?