Staging
v0.5.1
https://github.com/python/cpython
Revision a5cbab552d294d99fde864306632d7e511a75d3c authored by Thomas Moreau on 16 February 2020, 18:09:26 UTC, committed by GitHub on 16 February 2020, 18:09:26 UTC


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
1 parent 1ed6161
History
Tip revision: a5cbab552d294d99fde864306632d7e511a75d3c authored by Thomas Moreau on 16 February 2020, 18:09:26 UTC
bpo-39104: Fix hanging ProcessPoolExecutor on shutdown nowait with pickling failure (GH-17670)
Tip revision: a5cbab5
File Mode Size
windows-release
ci.yml -rw-r--r-- 3.2 KB
docs-steps.yml -rw-r--r-- 1.3 KB
macos-steps.yml -rw-r--r-- 771 bytes
posix-deps-apt.sh -rwxr-xr-x 590 bytes
posix-steps.yml -rw-r--r-- 2.5 KB
pr.yml -rw-r--r-- 3.2 KB
prebuild-checks.yml -rw-r--r-- 1.2 KB
windows-layout-steps.yml -rw-r--r-- 1.5 KB
windows-release.yml -rw-r--r-- 3.9 KB
windows-steps.yml -rw-r--r-- 1.5 KB

back to top