File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -273,9 +273,6 @@ def shutdown_worker():
273273 if not pending_work_items :
274274 shutdown_worker ()
275275 return
276- else :
277- # Start shutting down by telling a process it can exit.
278- call_queue .put_nowait (None )
279276 except Full :
280277 # This is not a problem: we will eventually be woken up (in
281278 # result_queue.get()) and be able to send a sentinel again.
Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ def test_interpreter_shutdown(self):
109109 self .assertFalse (err )
110110 self .assertEqual (out .strip (), b"apple" )
111111
112+ def test_hang_issue12364 (self ):
113+ fs = [self .executor .submit (time .sleep , 0.1 ) for _ in range (50 )]
114+ self .executor .shutdown ()
115+ for f in fs :
116+ f .result ()
117+
112118
113119class ThreadPoolShutdownTest (ThreadPoolMixin , ExecutorShutdownTest ):
114120 def _prime_executor (self ):
Original file line number Diff line number Diff line change @@ -422,6 +422,10 @@ Core and Builtins
422422Library
423423-------
424424
425+ - Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
426+ The hang would occur when retrieving the result of a scheduled future after
427+ the executor had been shut down.
428+
425429- Issue #13502: threading: Fix a race condition in Event.wait() that made it
426430 return False when the event was set and cleared right after.
427431
You can’t perform that action at this time.
0 commit comments