Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b44795

Browse files
committed
Close the call queue in concurrent.futures.ProcessPoolExecutor when
shutdown() is called, without waiting for the garbage collector to kick in.
1 parent f7f5475 commit 0b44795

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/concurrent/futures/process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def shutdown_one_process():
232232
# X.
233233
for p in processes:
234234
p.join()
235+
call_queue.close()
235236
return
236237
else:
237238
# Start shutting down by telling a process it can exit.

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Core and Builtins
3030
Library
3131
-------
3232

33+
- Close the call queue in concurrent.futures.ProcessPoolExecutor when
34+
shutdown() is called, without waiting for the garbage collector to kick in.
35+
3336
- Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by
3437
Andreas Stührk.
3538

0 commit comments

Comments
 (0)