Skip to content

Commit 178f57f

Browse files
committed
check if None
1 parent f6b8f8f commit 178f57f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

distributed/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ def __await__(self):
498498
return self.start().__await__()
499499

500500
async def cancel_start(self):
501-
self.__startup_task.cancel()
501+
if self.__startup_task:
502+
self.__startup_task.cancel()
503+
await self.started()
502504

503505
async def start_unsafe(self):
504506
"""Attempt to start the server. This is not idempotent and not protected against concurrent startup attempts.

distributed/nanny.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ async def close(
584584
# status to closing
585585
logger.info("Closing Nanny at %r. Reason: %s", self.address_safe, reason)
586586
await self.cancel_start()
587-
await self.started()
588587

589588
self.status = Status.closing
590589

distributed/worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,6 @@ async def close( # type: ignore
15191519
# Make sure we're not colliding with the startup coro when setting the
15201520
# status to closing
15211521
await self.cancel_start()
1522-
await self.started()
15231522
self.status = Status.closing
15241523

15251524
# Stop callbacks before giving up control in any `await`.

0 commit comments

Comments
 (0)