Spurious CancelledError on LocalCluster.close()
See original GitHub issueThe following repro produces a spurious log error from tornado/asyncio on closing the LocalCluster:
[00:36:18.413 ERROR ] Exception in Future <Future cancelled> after timeout
Traceback (most recent call last):
File "../lib/python3.5/site-packages/tornado/gen.py", line 970, in error_callback
future.result()
File "../lib/python3.5/asyncio/futures.py", line 286, in result
raise CancelledError
concurrent.futures._base.CancelledError
Here is the repro:
from joblib import parallel_backend
import distributed.joblib
from distributed import Client, LocalCluster
def run_example():
lc = LocalCluster(n_workers=1)
client = Client(lc)
with parallel_backend('dask.distributed', scheduler_host=client.scheduler.address):
pass
client.close()
lc.close()
if __name__ == "__main__":
run_example()
Couldn’t figure out how to silence or what exactly is wrong here. Appreciate any guidance.
Distributed versions is 1.23.1 on python 3.5.6 and joblib 0.12.3
dask 0.19.1 py35_0
dask-core 0.19.1 py35_0
tornado 5.1 py35h14c3975_0
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Changelog — Dask.distributed 2022.12.1 documentation
This release fixed a potential security vulnerability relating to single-machine Dask clusters. Clusters started with dask.distributed.LocalCluster or dask.
Read more >What is the "right" way to close a Dask LocalCluster?
Expanding on skibee's answer, here is a pattern I use. It sets up a temporary LocalCluster and then shuts it down.
Read more >Changelog — Dask.distributed 2.11.0 documentation
Update worker_kwargs description in LocalCluster constructor (GH#3438) ... worker.close() awaits batched_stream.close() (GH#3291) Mads R. B. ...
Read more >Cancelling dask task and handling of BaseException(asyncio ...
CancelledError . Calling the cancel() method on the dask future would not work since the task is already started.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was also getting the same error message. I couldn’t figure out how to stop the error message so I manually closed the client before exiting and caught the exception.
Yes, installing @danpf’s patch on my client machine seems to have fixed the issue.