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

[3.12] gh-125451: Fix deadlock in ProcessPoolExecutor shutdown (GH-125492) by colesbury · Pull Request #125599 · python/cpython · GitHub

/ cpython Public

[3.12] gh-125451: Fix deadlock in ProcessPoolExecutor shutdown (GH-125492) - #125599

Merged
colesbury merged 1 commit into
python:3.12from
colesbury:backport-760872e-3.12
Oct 16, 2024
Merged

[3.12] gh-125451: Fix deadlock in ProcessPoolExecutor shutdown (GH-125492)#125599
colesbury merged 1 commit into
python:3.12from
colesbury:backport-760872e-3.12

Conversation

colesbury commented Oct 16, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

There was a deadlock when ProcessPoolExecutor shuts down at the same time that a queueing thread handles an error processing a task.

Don't use _shutdown_lock to protect the _ThreadWakeup pipes -- use an internal lock instead. This fixes the ordering deadlock where the ExecutorManagerThread holds the _shutdown_lock and joins the queueing thread, while the queueing thread is attempting to acquire the _shutdown_lock while closing the _ThreadWakeup.
(cherry picked from commit 760872e)

…ythonGH-125492)

There was a deadlock when `ProcessPoolExecutor` shuts down at the same
time that a queueing thread handles an error processing a task.

Don't use `_shutdown_lock` to protect the `_ThreadWakeup` pipes -- use
an internal lock instead. This fixes the ordering deadlock where the
`ExecutorManagerThread` holds the `_shutdown_lock` and joins the
queueing thread, while the queueing thread is attempting to acquire the
`_shutdown_lock` while closing the `_ThreadWakeup`.
(cherry picked from commit 760872e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL