Staging
v0.5.1
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
File Mode Size
appendix.rst -rw-r--r-- 4.5 KB
appetite.rst -rw-r--r-- 4.4 KB
classes.rst -rw-r--r-- 36.3 KB
controlflow.rst -rw-r--r-- 32.2 KB
datastructures.rst -rw-r--r-- 24.0 KB
errors.rst -rw-r--r-- 16.9 KB
floatingpoint.rst -rw-r--r-- 10.9 KB
index.rst -rw-r--r-- 2.3 KB
inputoutput.rst -rw-r--r-- 18.6 KB
interactive.rst -rw-r--r-- 2.4 KB
interpreter.rst -rw-r--r-- 6.4 KB
introduction.rst -rw-r--r-- 17.5 KB
modules.rst -rw-r--r-- 23.8 KB
stdlib.rst -rw-r--r-- 11.0 KB
stdlib2.rst -rw-r--r-- 14.8 KB
venv.rst -rw-r--r-- 7.5 KB
whatnow.rst -rw-r--r-- 3.3 KB

back to top