diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -273,9 +273,6 @@ if not pending_work_items: shutdown_worker() return - else: - # Start shutting down by telling a process it can exit. - call_queue.put_nowait(None) except Full: # This is not a problem: we will eventually be woken up (in # result_queue.get()) and be able to send a sentinel again. diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -400,6 +400,11 @@ # Submitting other jobs fails as well. self.assertRaises(BrokenProcessPool, self.executor.submit, pow, 2, 8) + def test_hang_issue12364(self): + fs = [self.executor.submit(time.sleep, 0.1) for _ in range(50)] + self.executor.shutdown() + for f in fs: + f.result() class FutureTests(unittest.TestCase): def test_done_callback_with_result(self):