From 1d0701b51c1dc354fb22af9b27b8f722f02daf63 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Wed, 17 Aug 2022 04:54:37 -0500 Subject: [PATCH] Only close scheduler in SpecCluster if it exists (#6888) --- distributed/deploy/spec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distributed/deploy/spec.py b/distributed/deploy/spec.py index 57602b704e3..39558f1c7e6 100644 --- a/distributed/deploy/spec.py +++ b/distributed/deploy/spec.py @@ -431,7 +431,8 @@ async def _close(self): else: logger.warning("Cluster closed without starting up") - await self.scheduler.close() + if self.scheduler: + await self.scheduler.close() for w in self._created: assert w.status in { Status.closing,