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

Fix decide_worker picking a closing worker #8032

Merged
merged 7 commits into from
Aug 3, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
lint
crusaderky committed Jul 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d5f1a83288e232dca65f5118fd61a33c5dae0921
8 changes: 4 additions & 4 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
@@ -8178,8 +8178,8 @@ def _task_to_client_msgs(ts: TaskState) -> dict[str, list[dict[str, Any]]]:

def decide_worker(
ts: TaskState,
all_workers: Set[WorkerState],
valid_workers: Set[WorkerState] | None,
all_workers: set[WorkerState],
valid_workers: set[WorkerState] | None,
objective: Callable[[WorkerState], Any],
) -> WorkerState | None:
"""
@@ -8199,13 +8199,13 @@ def decide_worker(
"""
assert all(dts.who_has for dts in ts.dependencies)
if ts.actor:
candidates = set(all_workers)
candidates = all_workers.copy()
else:
candidates = {wws for dts in ts.dependencies for wws in dts.who_has}
candidates &= all_workers
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #8019

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think this is a situation where an actual decide_worker unit test would be appropriate

if valid_workers is None:
if not candidates:
candidates = set(all_workers)
candidates = all_workers.copy()
else:
candidates &= valid_workers
if not candidates: