dask / dask/distributed

actor is created in different client

Open
#7,842 0 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

**Describe the issue**:
Actors get created on the default client despite of explicitly specifying the client to create them and retrieve their results.

**Minimal Complete Verifiable Example**:

```python
from dask.distributed import Client

class Counter:
def __init__(self):
self.n = 0

if __name__ == '__main__':
with Client(n_workers=2) as client1:
with Client(n_workers=1) as client2:
futures = []
for worker in list(client1.scheduler_info()['workers'].keys()):
futures.append(client1.submit(Counter, workers=[worker], actor=True))
actors = client1.gather(futures)
for actor in actors:
assert actor.client is client1

```
The assert here fails, since the actors are created in `client2` (the default client).

**Environment**:

- Dask version: 2023.5.0
- Python version: 3.10
- Operating System: MacOS
- Install method (conda, pip, source): conda

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.