8000 [3.8] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) by viktorvorobev · Pull Request #28239 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
10000

[3.8] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) #28239

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

Closed
wants to merge 1 commit into from
Closed

[3.8] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) #28239

wants to merge 1 commit into from

Conversation

viktorvorobev
Copy link
@viktorvorobev viktorvorobev commented Sep 8, 2021

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

@the-knights-who-say-ni
Copy link

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 Missing

Our 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
before our records are updated.

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
@ambv
Copy link
Contributor
ambv commented Sep 8, 2021

This isn't a security fix and as such we can't accept it. See more: https://devguide.python.org/devcycle/#security-branches

@ambv ambv closed this Sep 8, 2021
@viktorvorobev viktorvorobev deleted the backport-c10c2ec-3.8 branch September 9, 2021 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0