-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
bpo-38707: Fix for multiprocessing.Process MainThread.native_id #17088
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
Conversation
3816eee to
9bca1c8
Compare
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.
Looks good!
|
Tests passed – ready to merge! @brandtbucher |
|
CC @pitrou |
|
cc @vstinner |
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 except for one minor comment.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I didn't expect the Spanish Inquisition :) |
|
Nobody expects the Spanish Inquisition! @pitrou: please review the changes made to this pull request. |
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.
+1
|
@jaketesler: Status check is done, and it's a success ✅ . |
|
Thanks @jaketesler for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…onGH-17088) This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou (cherry picked from commit c6b20be) Co-authored-by: Jake Tesler <jake.tesler@gmail.com>
|
GH-17261 is a backport of this pull request to the 3.8 branch. |
…7088) This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou (cherry picked from commit c6b20be) Co-authored-by: Jake Tesler <jake.tesler@gmail.com>
…onGH-17088) This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou
…onGH-17088) This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou
This PR implements a fix for
multiprocessing.Processobjects; the error occurs when Processes are created using eitherforkorforkserveras thestart_method.In these instances, the
MainThreadof the newly createdProcessobject retains all attributes from its parent'sMainThreadobject, including thenative_idattribute. The resulting behavior is such that the new process'MainThreadcaptures an incorrect/outdatednative_id(the parent's instead of its own).This change forces the Process object to update its
native_idattribute during the bootstrap process.cc @vstinner
https://bugs.python.org/issue38707
Automerge-Triggered-By: @pitrou