Author basnijholt
Recipients asvetlov, basnijholt, yselivanov
Date 2019-03-13.17:36:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The following code in Python 3.7.1
import random
import concurrent.futures
import asyncio

executor = concurrent.futures.ProcessPoolExecutor()
ioloop = asyncio.get_event_loop()

async def func():
    result = await ioloop.run_in_executor(executor, random.random)
    executor.shutdown(wait=False)  # bug doesn't occur when `wait=True`

task = ioloop.create_task(func())

prints the following error:
Exception in thread QueueManagerThread:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/", line 917, in _bootstrap_inner
  File "/opt/conda/lib/python3.7/", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.7/concurrent/futures/", line 368, in _queue_management_worker
  File "/opt/conda/lib/python3.7/concurrent/futures/", line 92, in clear
    while self._reader.poll():
  File "/opt/conda/lib/python3.7/multiprocessing/", line 255, in poll
  File "/opt/conda/lib/python3.7/multiprocessing/", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

I think this is related to and

This happens in the Adaptive package and the related issue is
Date User Action Args
2019-03-13 17:36:22basnijholtsetrecipients: + basnijholt, asvetlov, yselivanov
2019-03-13 17:36:22basnijholtsetmessageid: <>
2019-03-13 17:36:22basnijholtlinkissue36281 messages
2019-03-13 17:36:22basnijholtcreate