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

Make assumption in P2P's barrier mechanism explicit #8926

Merged
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
4 changes: 4 additions & 0 deletions distributed/shuffle/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ def id(self) -> ShuffleId:
def run_id(self) -> int:
return self.run_spec.run_id

@property
def archived(self) -> bool:
return self._archived_by is not None

def __str__(self) -> str:
return f"{self.__class__.__name__}<{self.id}[{self.run_id}]>"

Expand Down
6 changes: 6 additions & 0 deletions distributed/shuffle/_scheduler_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ async def barrier(self, id: ShuffleId, run_id: int, consistent: bool) -> None:
shuffle.id,
)
if any(w not in self.scheduler.workers for w in workers):
if not shuffle.archived:
# If the shuffle is not yet archived, this could mean that the barrier task fails
# before the P2P restarting mechanism can kick in.
raise P2PIllegalStateError(
"Expected shuffle to be archived if participating worker is not known by scheduler"
)
raise RuntimeError(
f"Worker {workers} left during shuffle {shuffle}"
)
Expand Down
Loading