Skip to content

Fix for hang due to mp.Pool in bootstrap_stderr #3135

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ankitgola005
Copy link

mp.pool created in bootstrap_stderr is not joined with pool.join() after it is finished, causing a hang-like situtation when too many processes get spawned.
From the documentation at https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.join,
Pool.close() only lets pool know to stop accepting further multiprocess requests. In absence of join, the resources are not relinquished.

Starting Python >= 3.3, Pool supports CM protocol.
Replaced existing implementation with a mp.pool CM to automatically handle pool.close() and pool.join().

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2025

CLA assistant check
All committers have signed the CLA.

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