X Tutup
The Wayback Machine - https://web.archive.org/web/20250624173658/https://github.com/python/cpython/pull/21166
Skip to content

bpo-41125: Display exit-codes for abruptly terminated processes in concurrent.futures #21166

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 9 commits into
base: main
Choose a base branch
from

Conversation

EpicWink
Copy link
Contributor

@EpicWink EpicWink commented Jun 26, 2020

Set multiprocessing.ProcessError with process exit-codes as the cause of the raised concurrent.futures.process.BrokenProcessPool1 when a process in the process-pool is terminated (this BrokenProcessPool exception is raised in user-code on future.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-code


Implementation notes:

  • concurrent.futures.process._ExecutorManagerThread.terminate_broken now accepts an exception instance instead of a list of strings
  • concurrent.futures.process._ExecutorManagerThread.wait_result_broken_or_wakeup now returns an exception instance in the tuple's third element instead of a list of strings

https://bugs.python.org/issue41125

@furkanonder
Copy link
Contributor

CC: @vstinner

@vstinner
Copy link
Member

CC: @vstinner

I don't have the bandwidth to review this PR. You will have to find another reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
X Tutup