Scheduler plugins created through dask-gateway don't have their close() method called
- Dominant language
- Python
- Stars
- 148
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
**What happened**:
Given a small SchedulerPlugin running on Kubernetes:
```python
from dask_gateway import GatewayCluster
import dask.distributed
class SomePlugin(dask.distributed.SchedulerPlugin):
async def close(self):
print("Closing")
with GatewayCluster(...) as cluster:
client = cluster.get_client()
client..register_scheduler_plugin(SomePlugin())
```
The `close()` method is never called on the SchedulerPlugin. The `start()` method is, however.
**What you expected to happen**:
`close()` should be called
**Minimal Complete Verifiable Example**:
```python
from dask_gateway import GatewayCluster
import dask.distributed
class SomePlugin(dask.distributed.SchedulerPlugin):
async def close(self):
print("Closing")
with GatewayCluster(...) as cluster:
client = cluster.get_client()
client..register_scheduler_plugin(SomePlugin())
```
**Anything else we need to know?**:
**Environment**:
- Dask version: latest
- Python version: 3.9
- Operating System: Ubuntu
- Install method (conda, pip, source): pip
Contributor guide
Assessment
This issue has not been assessed yet.