Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions distributed/tests/test_worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,20 @@ def test_gather_dep_failure(ws):
ws.validate = False


def test_recompute_erred_task(ws):
instructions = ws.handle_stimulus(
ComputeTaskEvent.dummy("x", run_id=1, stimulus_id="s1"),
ExecuteFailureEvent.dummy("x", run_id=1, stimulus_id="s2"),
ComputeTaskEvent.dummy("x", run_id=2, stimulus_id="s3"),
)
assert instructions == [
Execute(key="x", stimulus_id="s1"),
TaskErredMsg.match(key="x", run_id=1, stimulus_id="s2"),
Execute(key="x", stimulus_id="s3"),
]
assert ws.tasks["x"].state == "executing"


def test_transfer_incoming_metrics(ws):
assert ws.transfer_incoming_bytes == 0
assert ws.transfer_incoming_count == 0
Expand Down
5 changes: 1 addition & 4 deletions distributed/worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2868,17 +2868,14 @@ def _handle_compute_task(self, ev: ComputeTaskEvent) -> RecsInstrs:
ts, run_id=ev.run_id, stimulus_id=ev.stimulus_id
)
)
elif ts.state == "error":
instructions.append(
TaskErredMsg.from_task(ts, run_id=ev.run_id, stimulus_id=ev.stimulus_id)
)
elif ts.state in {
"released",
"fetch",
"flight",
"missing",
"cancelled",
"resumed",
"error",
}:
recommendations[ts] = "waiting"

Expand Down