bpo-41125: Display exit-codes for abruptly terminated processes in concurrent.futures #21166
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.


Set
multiprocessing.ProcessErrorwith process exit-codes as the cause of the raisedconcurrent.futures.process.BrokenProcessPool1 when a process in the process-pool is terminated (this BrokenProcessPool exception is raised in user-code onfuture.result(), for all current futures from the executor).In addition, negative exit-codes are converted to their respective signals, as per the documentation.
1 When the cause is
None. When the cause is not None, then there is a failure to retrieve the process's return value or raised exception (eg broken pipe). If the process dies without putting anything on the result queue (such as seg-fault, os-kill, etc), then cause is None, and the only information to be retrieved is the process's exit-codeImplementation notes:
concurrent.futures.process._ExecutorManagerThread.terminate_brokennow accepts an exception instance instead of a list of stringsconcurrent.futures.process._ExecutorManagerThread.wait_result_broken_or_wakeupnow returns an exception instance in the tuple's third element instead of a list of stringshttps://bugs.python.org/issue41125