Skip to content

Commit 5e88846

Browse files
committed
pythongh-94440: Fix issue of ProcessPoolExecutor shutdown hanging
- documentation enhancement
1 parent 1f444b2 commit 5e88846

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Lib/concurrent/futures/process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ def run(self):
364364
if self.is_shutting_down():
365365
self.flag_executor_shutting_down()
366366

367-
# If only canceled futures remain in pending_work_items, we
368-
# should purge them now to avoid waiting forever in our
369-
# subsequent call to wait_result_broken_or_wakeup.
367+
# When only canceled futures remain in pending_work_items, our
368+
# next call to wait_result_broken_or_wakeup would hang forever.
369+
# This makes sure we have some running futures or none at all.
370370
self.add_call_item_to_queue()
371371

372372
# Since no new work items can be added, it is safe to shutdown

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ Thomas Perl
13671367
Mathieu Perreault
13681368
Mark Perrego
13691369
Trevor Perrin
1370+
Yonatan Perry
13701371
Gabriel de Perthuis
13711372
Tim Peters
13721373
Benjamin Peterson

0 commit comments

Comments
 (0)