diff --git a/distributed/__init__.py b/distributed/__init__.py index d8e20f367f..d71af1f182 100644 --- a/distributed/__init__.py +++ b/distributed/__init__.py @@ -7,7 +7,14 @@ # isort: on import atexit +import weakref +# This finalizer registers an atexit handler that has to happen before +# distributed registers its handlers, otherwise we observe hangs on +# cluster shutdown when using the UCX comms backend. See +# https://github.com/dask/distributed/issues/7726 for more discussion + +weakref.finalize(lambda: None, lambda: None) import dask from dask.config import config # type: ignore