[3.8] bpo-37788: Fix reference leak when Thread is never joined (GH-26103)#28239
[3.8] bpo-37788: Fix reference leak when Thread is never joined (GH-26103)#28239viktorvorobev wants to merge 1 commit intopython:3.8python/cpython:3.8from viktorvorobev:backport-c10c2ec-3.8Copy head branch name to clipboard
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: @victorvorobev For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown. If many threads are created this way, the _shutdown_locks set could therefore grow endlessly. To avoid such a situation, purge expired locks each time a new one is added or removed. (cherry picked from commit c10c2ec) Co-authored-by: @pitrou
|
This isn't a security fix and as such we can't accept it. See more: https://devguide.python.org/devcycle/#security-branches |
This is a backport for #26103, automatic backport failed due to conflicts, hopefully I've done everything correctly.
Original PR description:
When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown. If many threads are created this way, the _shutdown_locks set could therefore grow endlessly. To avoid such a situation, purge expired locks each time a new one is added or removed.
Co-authored-by: @pitrou
https://bugs.python.org/issue37788