FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.8] bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088) by miss-islington · Pull Request #17261 · python/cpython · GitHub

Repository navigation

[3.8] bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088) - #17261

Merged
miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-c6b20be-3.8
Nov 19, 2019
Merged

miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-c6b20be-3.8

Conversation

miss-islington commented Nov 19, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

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

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
(cherry picked from commit c6b20be)

Co-authored-by: Jake Tesler <jake.tesler@gmail.com>

pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

+1

Copy link
Copy Markdown
Contributor Author

@jaketesler: Status check is done, and it's a success ✅ .

miss-islington merged commit 829593a into python:3.8 Nov 19, 2019
miss-islington deleted the backport-c6b20be-3.8 branch November 19, 2019 20:11

Copy link
Copy Markdown
Contributor Author

@jaketesler: Status check is done, and it's a success ✅ .

1 similar comment

Copy link
Copy Markdown
Contributor Author

@jaketesler: Status check is done, and it's a success ✅ .

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL