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

Fix detection of existing tasks #8970

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 @@ -54,7 +54,7 @@

import dask
import dask.utils
from dask._task_spec import DependenciesMapping, GraphNode, convert_legacy_graph
from dask._task_spec import DependenciesMapping, GraphNode, convert_legacy_graph, _MultiContainer
from dask.base import TokenizationError, normalize_token, tokenize
from dask.core import istask, validate_key
from dask.typing import Key, no_default
Expand Down Expand Up @@ -4868,6 +4868,7 @@ async def update_graph(
graph=graph,
global_annotations=annotations or {},
keys=keys,
existing_keys=set(self.tasks),
validate=self.validate,
)

Expand Down Expand Up @@ -9392,6 +9393,7 @@ def _materialize_graph(
global_annotations: dict[str, Any],
validate: bool,
keys: set[Key],
existing_keys: set[Key],
) -> tuple[dict[Key, T_runspec], dict[Key, set[Key]], dict[str, dict[Key, Any]]]:
dsk: dict = ensure_dict(graph)
if validate:
Expand All @@ -9411,7 +9413,7 @@ def _materialize_graph(
{k: (value(k) if callable(value) else value) for k in layer}
)

dsk2 = convert_legacy_graph(dsk)
dsk2 = convert_legacy_graph(dsk, all_keys=_MultiContainer(dsk, existing_keys))
# FIXME: There should be no need to fully materialize and copy this but some
# sections in the scheduler are mutating it.
dependencies = {k: set(v) for k, v in DependenciesMapping(dsk2).items()}
Expand Down
Loading