diff options
author | Thomas Moreau <thomas.moreau.2010@gmail.com> | 2020-02-16 18:09:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-16 18:09:26 (GMT) |
commit | a5cbab552d294d99fde864306632d7e511a75d3c (patch) | |
tree | 3f12da3e9bc19c5ae9e836a6694d90cc9ddd35d6 /Misc | |
parent | 1ed61617a4a6632905ad6a0b440cd2cafb8b6414 (diff) | |
download | cpython-a5cbab552d294d99fde864306632d7e511a75d3c.zip cpython-a5cbab552d294d99fde864306632d7e511a75d3c.tar.gz cpython-a5cbab552d294d99fde864306632d7e511a75d3c.tar.bz2 |
bpo-39104: Fix hanging ProcessPoolExecutor on shutdown nowait with pickling failure (GH-17670)
As reported initially by @rad-pat in #6084, the following script causes a deadlock.
```
from concurrent.futures import ProcessPoolExecutor
class ObjectWithPickleError():
"""Triggers a RuntimeError when sending job to the workers"""
def __reduce__(self):
raise RuntimeError()
if __name__ == "__main__":
e = ProcessPoolExecutor()
f = e.submit(id, ObjectWithPickleError())
e.shutdown(wait=False)
f.result() # Deadlock on get
```
This is caused by the fact that the main process is closing communication channels that might be necessary to the `queue_management_thread` later. To avoid this, this PR let the `queue_management_thread` manage all the closing.
https://bugs.python.org/issue39104
Automerge-Triggered-By: @pitrou
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-02-16-18-49-16.bpo-39104.cI5MJY.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-02-16-18-49-16.bpo-39104.cI5MJY.rst b/Misc/NEWS.d/next/Library/2020-02-16-18-49-16.bpo-39104.cI5MJY.rst new file mode 100644 index 0000000..52779bf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-16-18-49-16.bpo-39104.cI5MJY.rst @@ -0,0 +1,2 @@ +Fix hanging ProcessPoolExcutor on ``shutdown(wait=False)`` when a task has +failed pickling. |