Skip to content

Commit

Permalink
Don't track TaskState instances unless validating (#8963)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait authored Dec 12, 2024
1 parent 3ef88b3 commit 06b7fee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@ def __init__(
run_spec: T_runspec | None,
state: TaskStateState,
group: TaskGroup,
validate: bool,
):
# Most of the attributes below are not initialized since there are not
# always required for every tasks. Particularly for large graphs, these
Expand Down Expand Up @@ -1468,7 +1469,8 @@ def __init__(
self.run_id = None
self.group = group
group.add(self)
TaskState._instances.add(self)
if validate:
TaskState._instances.add(self)

def __hash__(self) -> int:
return self._hash
Expand Down Expand Up @@ -1890,7 +1892,7 @@ def new_task(
if computation:
computation.groups.add(tg)

ts = TaskState(key, spec, state, tg)
ts = TaskState(key, spec, state, tg, validate=self.validate)

self.tasks[key] = ts

Expand Down

0 comments on commit 06b7fee

Please sign in to comment.