Skip to content

Move state validation from Scheduler to SchedulerState - #9224

Merged
crusaderky merged 1 commit into
dask:mainfrom
crusaderky:validate-scheduler
Apr 28, 2026
Merged

crusaderky merged 1 commit into
dask:mainfrom
crusaderky:validate-scheduler

Conversation

@crusaderky

@crusaderky crusaderky commented Apr 28, 2026 •

Copy link
Copy Markdown
Collaborator

99.9% of scheduler state validation belongs to the SchedulerState.
This PR also cleans up a downcast antipattern from SchedulerState to Scheduler.

@crusaderky
crusaderky requested a review from fjetter as a code owner April 28, 2026 11:59
Comment thread distributed/scheduler.py

return msg

###################

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These methods have been copied verbatim, with the exception of two rows in validate_state (see below)

Comment thread distributed/scheduler.py
Comment on lines 5894 to 5895
if not (set(self.workers) == set(self.stream_comms)):
raise ValueError("Workers not the same in all collections")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These two lines is the only bit of state validation that is not exclusive to the SchedulerState

@crusaderky
crusaderky merged commit 30ecf55 into dask:main Apr 28, 2026
34 of 37 checks passed
@crusaderky
crusaderky deleted the validate-scheduler branch April 28, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant