Skip to content

Commit

Permalink
Off-by-one in the retries count in KilledWorker (#8203)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Sep 22, 2023
1 parent 2858930 commit e2ae9e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8449,8 +8449,8 @@ def allowed_failures(self) -> int:

def __str__(self) -> str:
return (
f"Attempted to run task {self.task} on {self.allowed_failures} different "
"workers, but all those workers died while running it. "
f"Attempted to run task {self.task} on {self.allowed_failures + 1} "
"different workers, but all those workers died while running it. "
f"The last worker that attempt to run the task was {self.last_worker.address}. "
"Inspecting worker logs is often a good next step to diagnose what went wrong. "
"For more information see https://distributed.dask.org/en/stable/killed.html."
Expand Down
4 changes: 2 additions & 2 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4244,8 +4244,8 @@ async def test_KilledWorker_informative_message(s, a, b):
with pytest.raises(KilledWorker) as excinfo:
raise ex
msg = str(excinfo.value)
assert "Attempted to run task foo-bar" in msg
assert str(s.allowed_failures) in msg
assert "Attempted to run task foo-bar on 667 different workers" in msg
assert a.address in msg
assert "worker logs" in msg
assert "https://distributed.dask.org/en/stable/killed.html" in msg

Expand Down

0 comments on commit e2ae9e6

Please sign in to comment.