-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant
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.
🤖 New build scheduled with the buildbot fleet by 6ebd095 🤖 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
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. 👍👍
Thanks @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit 6b73502) Co-authored-by: Noam Cohen <noam@noam.me>
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
Hi, the newly added test fails on systems without Traceback (most recent call last):
File "<string>", line 6, 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! |
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.