We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47e72fc commit 546ec80Copy full SHA for 546ec80
1 file changed
Lib/concurrent/futures/process.py
@@ -421,6 +421,10 @@ def shutdown_worker():
421
# - The executor that owns this worker has been shutdown.
422
if shutting_down():
423
try:
424
+ # Flag the executor as shutting down as early as possible if it
425
+ # is not gc-ed yet.
426
+ if executor is not None:
427
+ executor._shutdown_thread = True
428
# Since no new work items can be added, it is safe to shutdown
429
# this thread if there are no pending work items.
430
if not pending_work_items:
0 commit comments