async Client with sync LocalCluster
See original GitHub issueWhen a Client is passed a LocalCluster and the asynchronous=True flag, it silently ignores the explicit flag and gets it from the cluster instead.
>>> cluster = await distributed.LocalCluster(asynchronous=True)
>>> client = await distributed.Client(cluster, asynchronous=True)
>>> client.asynchronous
True
>>> cluster = distributed.LocalCluster()
>>> client = await distributed.Client(cluster, asynchronous=True)
>>> client.asynchronous
False
>>> cluster = distributed.LocalCluster()
>>> client = await distributed.Client(cluster.scheduler.address, asynchronous=True)
>>> client.asynchronous
True
The same happens for an eventual explicit loop parameter. Both issues are caused by these lines, which cause Client.loop to be forced to match Client.cluster.loop: https://github.com/dask/distributed/blob/9f91653398aee681ba0010b1053f3bd1b415894b/distributed/client.py#L647-L653
I see in the code how a few things will break if the client and client.cluster end up having two different event loops. Not sure what the correct solution would be?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
API — Dask.distributed 2022.12.1 documentation
The Client connects users to a Dask cluster. It provides an asynchronous user interface around functions and futures. This class resembles executors in ......
Read more >LocalCluster (Storm 2.3.0 API)
A stand alone storm cluster that runs inside a single process. It is intended to be used for testing. Both internal testing for...
Read more >Async client with sync server - Google Groups
Is it possible to have an async client while the server remains 'sync'. This could be handy for a use case where I...
Read more >Libraries and tools - etcd
Async HTTP client based on Netty and Scala Futures. mingchuno/etcd4s ... A set of distributed synchronization primitives built upon etcd ...
Read more >python-distributed-1.25.3-bp152.3.19 - SUSE Package Hub -
... Matthew Rocklin * Support async def functions in Client.sync (GH#2070) Matthew Rocklin * Add asynchronous parameter to docstring of LocalCluster Matthew ...
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
Yes, I think that erring loudly in this case, perhaps with the workaround that you suggested with the address would be a good solution.
On Mon, May 11, 2020 at 8:51 AM crusaderky notifications@github.com wrote:
FWIW, we’re seeing the reverse need in GPU land: sync client to an async cluster.
– Most of our code is async client <> async cluster – Many libs (ex: blazingsql) assume sync client, which seems to require a sync cluster – We don’t want 2 clusters, as dask_cudf / RMM takes ~300MB baseline per instance – … so we’d like to occasionally generate a sync client to an existing async cluster