Error connecting to dask client - giving error There is no current event loop in thread when not using asyncio
- 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
Assessment
This issue has not been assessed yet.