-
Notifications
You must be signed in to change notification settings - Fork 58
Runner errors for Python 3.7 when done #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Might actually be a bug in Python 3.7: https://bugs.python.org/issue34073 However, it's not exactly the same # Bug occurs in this way
import asyncio
from concurrent.futures import ProcessPoolExecutor
import os
loop = asyncio.get_event_loop_policy().new_event_loop()
loop.set_default_executor(ProcessPoolExecutor())
future = loop.run_in_executor(None, os.getpid)
print(loop.run_until_complete(future))
loop.close() # We're calling it like this with no error printed
import asyncio
from concurrent.futures import ProcessPoolExecutor
import os
loop = asyncio.get_event_loop_policy().new_event_loop()
ex = ProcessPoolExecutor()
future = loop.run_in_executor(ex, os.getpid)
print(loop.run_until_complete(future))
loop.close() |
The following code is causing the bug: import random
import concurrent.futures
import asyncio
executor = concurrent.futures.ProcessPoolExecutor()
ioloop = asyncio.get_event_loop()
async def _run():
result = await ioloop.run_in_executor(executor, random.random)
executor.shutdown(wait=False) # if `wait=True` the problem is gone
task = ioloop.create_task(_run()) |
I've opened an issue in the Python bug tracker: https://bugs.python.org/issue36281 |
basnijholt
added a commit
that referenced
this issue
Mar 18, 2019
basnijholt
added a commit
that referenced
this issue
Mar 18, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
basnijholt
added a commit
that referenced
this issue
Mar 18, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
Closed
basnijholt
added a commit
that referenced
this issue
Mar 21, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
basnijholt
added a commit
that referenced
this issue
Mar 21, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
basnijholt
added a commit
that referenced
this issue
Mar 21, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
basnijholt
added a commit
that referenced
this issue
May 8, 2019
See #156 This prevent the 'OSError: handle is closed' after the runner is closed in Python 3.7
basnijholt
added a commit
that referenced
this issue
Apr 10, 2020
until #156 and https://bugs.python.org/issue36281 and joblib/loky#241 are fixed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: