[issue39205] Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)

Brian Quinlan report at bugs.python.org
Fri Jan 3 16:26:24 EST 2020


New submission from Brian Quinlan <brian at sweetapp.com>:

```
from concurrent.futures import ProcessPoolExecutor
import time

t = ProcessPoolExecutor(max_workers=3)
t.map(time.sleep, [1,2,3])
t.shutdown(wait=False)
```

Results in this exception and then a hang (i.e. Python doesn't terminate):
```
Exception in thread QueueManagerThread:
Traceback (most recent call last):
  File "/usr/local/google/home/bquinlan/cpython/Lib/threading.py", line 944, in _bootstrap_inner
    self.run()
  File "/usr/local/google/home/bquinlan/cpython/Lib/threading.py", line 882, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/google/home/bquinlan/cpython/Lib/concurrent/futures/process.py", line 352, in _queue_management_worker
    _add_call_item_to_queue(pending_work_items,
  File "/usr/local/google/home/bquinlan/cpython/Lib/concurrent/futures/process.py", line 280, in _add_call_item_to_queue
    call_queue.put(_CallItem(work_id,
  File "/usr/local/google/home/bquinlan/cpython/Lib/multiprocessing/queues.py", line 82, in put
    raise ValueError(f"Queue {self!r} is closed")
ValueError: Queue <concurrent.futures.process._SafeQueue object at 0x7f371c4ae7f0> is closed
```

----------
assignee: bquinlan
messages: 359257
nosy: bquinlan
priority: normal
severity: normal
status: open
title: Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39205>
_______________________________________


More information about the Python-bugs-list mailing list