dask / dask/distributed

Error connecting to dask client - giving error There is no current event loop in thread when not using asyncio

Open
#3,156 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

We are trying to connect to dask client using Client(scheduler_url) syntax using concurrent.futures threadpool implementation and receiving the error below.

```
Traceback (most recent call last):
File "/home/app/dask.py", line 848, in get_dask_client
return Client(scheduler)
File "/base/anaconda/lib/python3.6/site-packages/distributed/client.py", line 668, in __init__
self._loop_runner = LoopRunner(loop=loop, asynchronous=asynchronous)
File "/base/anaconda/lib/python3.6/site-packages/distributed/utils.py", line 364, in __init__
current = IOLoop.current()
File "/base/andaconda/pithon3/lib/python3.6/site-packages/tornado/ioloop.py", line 265, in current
loop = asyncio.get_event_loop()
File "/base/anaconda/pithon3/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
return get_event_loop_policy().get_event_loop()
File "/base/anaconda/pithon3/lib/python3.6/asyncio/events.py", line 602, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
```

The function submitting the concurrent future is a async function but the function being executed is not async and not using asyncio in any way. Dont need an event loop but for some reason tornado requires it looks like.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.