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

Improve logging in P2P's scheduler plugin #8410

Merged
merged 1 commit into from
Dec 18, 2023
Merged
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
13 changes: 10 additions & 3 deletions distributed/shuffle/_scheduler_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
self.active_shuffles[spec.id] = state
self._shuffles[spec.id].add(state)
state.participating_workers.add(worker)
logger.warning(

Check warning on line 152 in distributed/shuffle/_scheduler_plugin.py

View check run for this annotation

Codecov / codecov/patch

distributed/shuffle/_scheduler_plugin.py#L152

Added line #L152 was not covered by tests
"Shuffle %s initialized by task %r executed on worker %s",
spec.id,
key,
worker,
)
return ToPickle(state.run_spec)

def _raise_if_barrier_unknown(self, id: ShuffleId) -> None:
Expand Down Expand Up @@ -310,7 +316,7 @@
self._fail_on_workers(shuffle, message=f"{shuffle} forgotten")
self._clean_on_scheduler(shuffle_id, stimulus_id=stimulus_id)
logger.debug(
"Shuffle %s forgotten because task '%s' transitioned to %s due to "
"Shuffle %s forgotten because task %r transitioned to %s due to "
"stimulus '%s'",
shuffle_id,
key,
Expand Down Expand Up @@ -341,9 +347,10 @@
}
self.scheduler.send_all({}, worker_msgs)

def _clean_on_scheduler(self, id: ShuffleId, stimulus_id: str | None) -> None:
def _clean_on_scheduler(self, id: ShuffleId, stimulus_id: str) -> None:
shuffle = self.active_shuffles.pop(id)
if not shuffle._archived_by and stimulus_id:
logger.warning("Shuffle %s deactivated due to stimulus '%s'", id, stimulus_id)
if not shuffle._archived_by:

Check warning on line 353 in distributed/shuffle/_scheduler_plugin.py

View check run for this annotation

Codecov / codecov/patch

distributed/shuffle/_scheduler_plugin.py#L352-L353

Added lines #L352 - L353 were not covered by tests
shuffle._archived_by = stimulus_id
self._archived_by_stimulus[stimulus_id].add(shuffle)

Expand Down
Loading