Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-132542: Set native thread ID after fork#132701
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
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.
Needs a blurb entry.
Uh oh!
There was an error while loading.Please reload this page.
bedevere-bot commentedApr 19, 2025
🤖 New build scheduled with the buildbot fleet by@ZeroIntensity for commit6ebd095 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132701%2Fmerge If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
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
Uh oh!
There was an error while loading.Please reload this page.
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. 👍👍
6b73502
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@noamcohen97 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit6b73502)Co-authored-by: Noam Cohen <noam@noam.me>
Sorry,@noamcohen97 and@serhiy-storchaka, I could not cleanly backport this to
|
GH-134356 is a backport of this pull request to the3.14 branch. |
GH-134361 is a backport of this pull request to the3.13 branch. |
kulikjak commentedMay 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi, the newly added test fails on systems without Traceback (most recent call last): File"<string>", line6, in<module> parent_thread_native_id= threading.current_thread().native_id^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError:'_MainThread' object has no attribute 'native_id' (while |
@kulikjak Thank you for noticing. I apologize for that. @serhiy-storchaka Can you please help with merging the fix? |
No worries, thanks for the fix! |
Uh oh!
There was an error while loading.Please reload this page.
Since most of Python's runtime state, including thread-related data, is only consistent after
PyOS_AfterFork_Child()
is called, updatingnative_id
in theafter_fork
handler ensures correctness and aligns with Python’s existing fork-handling mechanisms.