Only close scheduler in SpecCluster if it exists
@@ -431,6 +431,7 @@ class SpecCluster(Cluster):
else:
logger.warning("Cluster closed without starting up")
+ if self.scheduler:
await self.scheduler.close()
for w in self._created:
assert w.status in {
