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

Don't track TaskState instances unless validating #8963

Merged
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
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
Loading