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

Assert that a fetch->cancelled->resumed->fetch cycle is impossible #6460

Merged
merged 1 commit into from
Jun 1, 2022
Merged
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: 10 additions & 1 deletion distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,16 @@ def transition_resumed_fetch(
self, ts: TaskState, *, stimulus_id: str
) -> RecsInstrs:
"""See Worker._transition_from_resumed"""
return self._transition_from_resumed(ts, "fetch", stimulus_id=stimulus_id)
recs, instructions = self._transition_from_resumed(
ts, "fetch", stimulus_id=stimulus_id
)
if self.validate:
# This would only be possible in a fetch->cancelled->resumed->fetch loop,
# but there are no transitions from fetch which set the state to cancelled.
# If this assertion failed, we' need to call _ensure_communicating like in
# the other transitions that set ts.status = "fetch".
assert ts.state != "fetch"
return recs, instructions

def transition_resumed_missing(
self, ts: TaskState, *, stimulus_id: str
Expand Down