Skip to content

Worker.close() leaves RPC channels dangling #6409

@crusaderky

Description

@crusaderky

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

await s.remove_worker(
address=x.address, safe=True, close=close_worker, stimulus_id="test"
)

which in turn calls
if close:
with suppress(AttributeError, CommClosedError):
self.stream_comms[address].send({"op": "close"})

which in turrn calls
await self.rpc.close()

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions