diff --git a/distributed/core.py b/distributed/core.py index 250ea076e03..16c611142f4 100644 --- a/distributed/core.py +++ b/distributed/core.py @@ -606,7 +606,7 @@ def close(self): break else: yield asyncio.sleep(0.05) - yield [comm.close() for comm in self._comms] # then forcefully close + yield [comm.close() for comm in list(self._comms)] # then forcefully close for cb in self._ongoing_coroutines: cb.cancel() for i in range(10):