diff options
author | Jake Tesler <jake.tesler@gmail.com> | 2019-11-19 19:50:12 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-11-19 19:50:12 (GMT) |
commit | c6b20be85c0de6f2355c67ae6e7e578941275cc0 (patch) | |
tree | 1482aa6693e3fa4001a0a77c8fd50fb1a0223f66 /Misc/NEWS.d | |
parent | 892221bfa04a41cf581f988ba19dc263f557e157 (diff) | |
download | cpython-c6b20be85c0de6f2355c67ae6e7e578941275cc0.zip cpython-c6b20be85c0de6f2355c67ae6e7e578941275cc0.tar.gz cpython-c6b20be85c0de6f2355c67ae6e7e578941275cc0.tar.bz2 |
bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-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
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2019-11-08-00-36-10.bpo-38707.SZL036.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-11-08-00-36-10.bpo-38707.SZL036.rst b/Misc/NEWS.d/next/Core and Builtins/2019-11-08-00-36-10.bpo-38707.SZL036.rst new file mode 100644 index 0000000..4ef9ed8 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-11-08-00-36-10.bpo-38707.SZL036.rst @@ -0,0 +1 @@ +``MainThread.native_id`` is now correctly reset in child processes spawned using :class:`multiprocessing.Process`, instead of retaining the parent's value. |