Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed Sep 13, 2024
1 parent 6ca99f9 commit 3cdee06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 5 additions & 11 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1425,14 +1425,8 @@ class TaskState:
#: be rejected.
run_id: int | None

#: Whether to consider this task rootish in the context of task queueing
#: True
#: Always consider this task rootish
#: False
#: Never consider this task rootish
#: None
#: Use a heuristic to determine whether this task should be considered rootish
_rootish: bool | None
#: Whether to allow queueing this task if it is rootish
_queueable: bool

#: Cached hash of :attr:`~TaskState.client_key`
_hash: int
Expand Down Expand Up @@ -1489,7 +1483,7 @@ def __init__(
self.metadata = None
self.annotations = None
self.erred_on = None
self._rootish = None
self._queueable = True
self.run_id = None
self.group = group
group.add(self)
Expand Down Expand Up @@ -2286,7 +2280,7 @@ def decide_worker_rootish_queuing_disabled(
"""
if self.validate:
# See root-ish-ness note below in `decide_worker_rootish_queuing_enabled`
assert math.isinf(self.WORKER_SATURATION) or not ts._rootish
assert math.isinf(self.WORKER_SATURATION) or not ts._queueable

pool = self.idle.values() if self.idle else self.running
if not pool:
Expand Down Expand Up @@ -2452,7 +2446,7 @@ def _transition_waiting_processing(self, key: Key, stimulus_id: str) -> RecsMsgs
# removed, there should only be one, which combines co-assignment and
# queuing. Eventually, special-casing root tasks might be removed entirely,
# with better heuristics.
if math.isinf(self.WORKER_SATURATION) or not ts._rootish:
if math.isinf(self.WORKER_SATURATION) or not ts._queueable:
if not (ws := self.decide_worker_rootish_queuing_disabled(ts)):
return {ts.key: "no-worker"}, {}, {}
else:
Expand Down
2 changes: 1 addition & 1 deletion distributed/shuffle/_scheduler_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def _ensure_output_tasks_are_non_rootish(self, spec: ShuffleSpec) -> None:
"""
barrier = self.scheduler.tasks[barrier_key(spec.id)]
for dependent in barrier.dependents:
dependent._rootish = False
dependent._queueable = False

@log_errors()
def _set_restriction(self, ts: TaskState, worker: str) -> None:
Expand Down

0 comments on commit 3cdee06

Please sign in to comment.