Skip to content

Commit 4b50bb4

Browse files
committed
Drop the abrupt-exit-code reporting from the 3.14 backport
Reporting the exit codes of processes that died without a known cause is a new feature, not part of the gh-101267 bugfix. Keep only the bugfix on 3.14: each failed future gets its own BrokenProcessPool exception instead of one shared instance.
1 parent e4be990 commit 4b50bb4

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

Lib/concurrent/futures/process.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -472,22 +472,9 @@ def _terminate_broken(self, cause):
472472
# All pending tasks are to be marked failed with a
473473
# BrokenProcessPool error, as separate instances to avoid sharing
474474
# a traceback (gh-101267).
475-
cause_str = None
475+
cause_tb = None
476476
if cause is not None:
477-
cause_str = ''.join(cause)
478-
else:
479-
# No cause known, so report any processes that have
480-
# terminated with nonzero exit codes, e.g. from a
481-
# segfault. Multiple may terminate simultaneously,
482-
# so include all of them in the traceback.
483-
errors = []
484-
for p in self.processes.values():
485-
if p.exitcode is not None and p.exitcode != 0:
486-
errors.append(f"Process {p.pid} terminated abruptly "
487-
f"with exit code {p.exitcode}")
488-
if errors:
489-
cause_str = "\n".join(errors)
490-
cause_tb = f"\n'''\n{cause_str}'''" if cause_str else None
477+
cause_tb = f"\n'''\n{''.join(cause)}'''"
491478

492479
# Mark pending tasks as failed.
493480
for work_id, work_item in self.pending_work_items.items():

0 commit comments

Comments
 (0)