Skip to content

Commit

Permalink
pythongh-94440: Fix issue of ProcessPoolExecutor shutdown hanging
Browse files Browse the repository at this point in the history
- documentation enhancement
  • Loading branch information
yonatanp committed Jun 30, 2022
1 parent 1f444b2 commit 5e88846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/concurrent/futures/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def run(self):
if self.is_shutting_down():
self.flag_executor_shutting_down()

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

# Since no new work items can be added, it is safe to shutdown
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ Thomas Perl
Mathieu Perreault
Mark Perrego
Trevor Perrin
Yonatan Perry
Gabriel de Perthuis
Tim Peters
Benjamin Peterson
Expand Down

0 comments on commit 5e88846

Please sign in to comment.