Skip to content

Commit

Permalink
Add "ready->memory" to transitions in worker (#4728)
Browse files Browse the repository at this point in the history
* Add "ready->memory" to transitions in worker

This should remove the error message in #4721 but is more of a band-aid
than a fix.  Ready->memory transitions shouldn't happen, but since they
do occassionally crop up, we might as well dispatch them appropriately
until the worker state machine is ready.

* Default to `no_value`

* Update distributed/worker.py

Co-authored-by: James Bourbeau <[email protected]>

Co-authored-by: James Bourbeau <[email protected]>
  • Loading branch information
gforsyth and jrbourbeau authored Apr 22, 2021
1 parent f492aa7 commit 9fde837
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ def __init__(
("executing", "memory"): self.transition_executing_done,
("flight", "memory"): self.transition_flight_memory,
("flight", "fetch"): self.transition_flight_fetch,
# Shouldn't be a valid transition but happens nonetheless
("ready", "memory"): self.transition_ready_memory,
# Scheduler intercession (re-assignment)
("fetch", "waiting"): self.transition_fetch_waiting,
("flight", "waiting"): self.transition_flight_waiting,
Expand Down Expand Up @@ -1837,8 +1839,8 @@ def transition_ready_error(self, ts):
assert ts.traceback is not None
self.send_task_state_to_scheduler(ts)

def transition_ready_memory(self, ts, value=None):
if value:
def transition_ready_memory(self, ts, value=no_value):
if value is not no_value:
self.put_key_in_memory(ts, value=value)
self.send_task_state_to_scheduler(ts)

Expand Down

0 comments on commit 9fde837

Please sign in to comment.