Worker.close() leaves RPC channels dangling
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
Follow-up from #6371 and #6385.
CC @gjoseph92
``test_deadlock_cancelled_after_inflight_before_gather_from_worker`` removes a worker while another worker has a task in flight from it.
The test calls
https://github.com/dask/distributed/blob/9bb999d4b66670570d9d8f53d04501dec6a25e7e/distributed/tests/test_worker.py#L3282-L3284
which in turn calls
https://github.com/dask/distributed/blob/9bb999d4b66670570d9d8f53d04501dec6a25e7e/distributed/scheduler.py#L4172-L4174
which in turrn calls
https://github.com/dask/distributed/blob/9bb999d4b66670570d9d8f53d04501dec6a25e7e/distributed/worker.py#L1576
### Expected result
The RPC channel is explicitly shut down. The waiting gather_dep call on the other worker raises OSError within milliseconds.
### Actual result
The RPC channel is left dangling until the TCP timeout kicks in (5s by default; in the test it's been shortened to 0.5s).
Contributor guide
Assessment
This issue has not been assessed yet.