Skip to content

gh-134381: Improve thread safety in _PyThread_AfterFork by preserving not-started handles #134514

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

Merged
merged 8 commits into from
May 23, 2025

Conversation

zangjiucheng
Copy link
Contributor

@zangjiucheng zangjiucheng commented May 22, 2025

@python-cla-bot
Copy link

python-cla-bot bot commented May 22, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 22, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this? Something like the repro in the issue is probably fine.

@zangjiucheng
Copy link
Contributor Author

Could you add a test for this? Something like the repro in the issue is probably fine.

I did add a similar test case, but not sure if that's good enough to cover the issue similar to the issue mentioned. Please take a review.

@colesbury colesbury added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 22, 2025
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests looks good. Some comments about how to structure it in the multiprocessing test suite below.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, LGTM

@colesbury colesbury added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 23, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit ca06d61 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F134514%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 23, 2025
@colesbury colesbury self-assigned this May 23, 2025
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny little formatting suggestion.

@colesbury colesbury merged commit 9a2346d into python:main May 23, 2025
39 checks passed
@miss-islington-app
Copy link

Thanks @zangjiucheng for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 23, 2025
…d after fork (pythongh-134514)

(cherry picked from commit 9a2346d)

Co-authored-by: Jiucheng(Oliver) <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 23, 2025
…d after fork (pythongh-134514)

(cherry picked from commit 9a2346d)

Co-authored-by: Jiucheng(Oliver) <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 23, 2025

GH-134596 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 23, 2025
@bedevere-app
Copy link

bedevere-app bot commented May 23, 2025

GH-134597 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants