if `await worker.close()` fails - subsequent `await close()` calls hang forever
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
```python
from distributed.diagnostics.plugin import WorkerPlugin
from distributed.core import Server
@gen_test()
async def test_close_after_failure():
class Crashed(Exception):
pass
class CrashPlugin(WorkerPlugin):
async def teardown(self, *args, **kwargs):
raise Crashed
async def register_worker(comm, *args, **kwargs):
try:
await comm.write({"status": "OK", "time": 0, "worker-plugins": {}})
await comm.read()
finally:
await comm.close()
async with Server(handlers={"register-worker": register_worker}) as s:
await s.listen("inproc://")
async with Worker(s.address, plugins=(CrashPlugin(),)) as w:
with pytest.raises(Crashed):
await w.close()
with pytest.raises(Crashed):
await w.close() # hangs
```
Contributor guide
Assessment
This issue has not been assessed yet.