Skip to content
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

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

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 16, 2024

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 [email protected]

…GH-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 <[email protected]>
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.

2 participants