Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Flag workers as non-active and pause in case of graceful shutdown #3564

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions distributed/deploy/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,10 @@ async def _correct_state_internal(self):
pre = list(set(self.workers))
to_close = set(self.workers) - set(self.worker_spec)
if to_close:
if self.scheduler.status == "running":
await self.scheduler_comm.retire_workers(workers=list(to_close))
tasks = [self.workers[w].close() for w in to_close if w in self.workers]
await asyncio.wait(tasks)
for task in tasks: # for tornado gen.coroutine support
with ignoring(RuntimeError):
await task
await self.scheduler_comm.retire_workers(
names=list(to_close), close_workers=True
)

for name in to_close:
if name in self.workers:
del self.workers[name]
Expand Down
Loading