4

I have set up a dask cluster. I can access a web dashboard, but when I'm trying to connect to the scheduler:

from dask.distributed import Client
client = Client('192.168.0.10:8786')

I get the following error:

tornado.application - ERROR - Exception in Future <Future cancelled> after timeout
Traceback (most recent call last):
  File "/home/user/venv/lib/python3.5/site-packages/tornado/gen.py", line 970, in error_callback
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 285, in result
    raise CancelledError
concurrent.futures._base.CancelledError

Also, when I'm trying to execute some tasks on the cluster, all tasks are computed correctly and the result is fetched but then the above error occurs at the end.

Do you have any ideas how to fix it? I think it's a client problem, but where. Thank you very much.

Vladyslav Moisieienkov
  • 4,118
  • 4
  • 25
  • 32
  • Without more information I'm not sure how anyone can help with this. I recommend trying to provide an [MCVE](https://stackoverflow.com/help/mcve) that someone can use to reproduce the failure. – MRocklin Sep 18 '18 at 17:22
  • 1
    [this question](https://stackoverflow.com/questions/53394935) looks similar with some MCVE. The problem with this error is that it is "non - deterministic" - it appears once in a while running exactly the same code. – Primer Nov 26 '18 at 18:09

1 Answers1

0

You are running sync function in async tornado

Try this one:

from dask.distributed import Client
from tornado.ioloop import IOLoop

async def f():
    client = await Client(address='192.168.0.10:8786', asynchronous=True)
    future = client.submit(DO SOMETHING HERE)
    result = await future
    await client.close()
    return result


IOLoop().run_sync(f)
Pauel
  • 11
  • 2