diff options
author | Louis Paulot <55740424+lpaulot@users.noreply.github.com> | 2023-07-10 21:45:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 21:45:27 (GMT) |
commit | 6782fc050281205734700a1c3e13b123961ed15b (patch) | |
tree | c1e4b8d2154fddecfe095736202a04f96995c9aa /Lib/concurrent | |
parent | 9d582250d8fde240b8e7299b74ba888c574f74a3 (diff) | |
download | cpython-6782fc050281205734700a1c3e13b123961ed15b.zip cpython-6782fc050281205734700a1c3e13b123961ed15b.tar.gz cpython-6782fc050281205734700a1c3e13b123961ed15b.tar.bz2 |
gh-94777: Fix deadlock in ProcessPoolExecutor (#94784)
Fixes a hang in multiprocessing process pool executor when a child process crashes and code could otherwise block on writing to the pipe. See GH-94777 for more details.
Diffstat (limited to 'Lib/concurrent')
-rw-r--r-- | Lib/concurrent/futures/process.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 816edab..301207f 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -499,6 +499,10 @@ class _ExecutorManagerThread(threading.Thread): for p in self.processes.values(): p.terminate() + # Prevent queue writing to a pipe which is no longer read. + # https://github.com/python/cpython/issues/94777 + self.call_queue._reader.close() + # clean up resources self.join_executor_internals() |