gh-90622: Prevent concurrent.futures.process deadlock due to fork() after spawning a thread. #30847
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1ac6e37 released in 3.9 as a performance enhancement to
concurrent.futures
introduced a deadlock in some environments by violating the POSIX spec with new child processes being fork()ed after a thread had been started. This reverts that. It also reverts fdc0e09 which tried to add a newmax_tasks_per_child feature
for 3.11 that built upon the previous ill fated 3.9 performance enhancement.There is a better way to do this that would not fork after starting a thread, but implementing that is a much larger architectural enhancement; not something that could be back-ported as a bug fix.
The 3.10 backport will need to be manual as it doesn't have the 3.11 change. The 3.9 one can be autogenerated from that. Alternatively I could split this PR into two separate rollbacks.
https://bugs.python.org/issue46464