Skip to content

Commit

Permalink
Assert that a fetch->cancelled->resumed->fetch cycle is impossible
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed May 26, 2022
1 parent e0ea5df commit d589739
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,14 @@ 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
)
# This would only be possible in a fetch->cancelled->fetch loop, but there's
# no such transition from fetch which sets the state to cancelled.
# Thus, there's no need to call _ensure_communicating.
assert ts.state != "fetch"
return recs, instructions

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

0 comments on commit d589739

Please sign in to comment.