Skip to content

Commit

Permalink
WorkerProcess blocks on kill if still starting
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed Dec 1, 2022
1 parent 5f217ab commit ee44cde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion distributed/nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,12 @@ async def kill(
if self.status == Status.stopping:
await self.stopped.wait()
return
# If the process is not properly up it will not watch the closing queue
# and we may end up leaking this process.
# Therefore wait for it to be properly started before killing it.
if self.status == Status.starting:
await self.running.wait()
assert self.status in (
Status.starting,
Status.running,
Status.failed, # process failed to start, but hasn't been joined yet
), self.status
Expand Down

0 comments on commit ee44cde

Please sign in to comment.