dask / distributed

A distributed task scheduler for Dask
https://distributed.dask.org
BSD 3-Clause "New" or "Revised" License
1.57k stars 718 forks source link

Swallowing the `CommClosedError` when the stream handler closes may remove relevant exception information #8683

Open hendrikmakait opened 3 months ago

hendrikmakait commented 3 months ago

In https://github.com/dask/distributed/blob/5708bdf37fe8daf697115cd6c90c07148b6dffb1/distributed/core.py#L1027-L1033

we always swallow the CommClosedError without even logging it. This can be problematic because we use this error both for the happy and the sad path of stream handler closing. For example, in convert_stream_closed_error (https://github.com/dask/distributed/blob/5708bdf37fe8daf697115cd6c90c07148b6dffb1/distributed/comm/tcp.py#L130-L143), we may attach relevant exception information to the CommClosedError but will subsequently ignore it in handle_stream.

Ideally, we could differentiate between when stream handler closing is expected and when it's unexpected and log more information in the latter case.