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

Unique Spans #7882

Merged
merged 1 commit into from
Jun 7, 2023
Merged

Unique Spans #7882

merged 1 commit into from
Jun 7, 2023

Conversation

crusaderky
Copy link
Collaborator

@crusaderky crusaderky commented Jun 4, 2023

Change spans so that, if a user opens and reopens a span context manager with the same tag, it counts as separate spans - e.g. in case of repeated calsl to the same high-level library.

The 'default' span now automatically closes and reopens itself into a new 'default' span when the cluster is idle, save for all tasks not explicitly annotated with span. This effectively replicates 1:1 the behaviour of computations.

CC @hendrikmakait @mrocklin @ntabris

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2023

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       20 files  ±  0         20 suites  ±0   11h 30m 17s ⏱️ - 18m 10s
  3 669 tests +  3    3 558 ✔️ +  1     108 💤 ±0  3 +2 
35 480 runs  +30  33 713 ✔️ +28  1 764 💤 ±0  3 +2 

For more details on these failures, see this check.

Results for commit b474c16. ± Comparison against base commit 129b7cb.

♻️ This comment has been updated with latest results.

Copy link
Member

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @crusaderky!

distributed/spans.py Show resolved Hide resolved
ts.annotations.pop("span", None)

def _ensure_default_span(self) -> Span:
"""Return the currently active default span, or create one if the previous one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out-of-scope: I'm not a huge fan of this as it's not very reproducible. Let's keep thinking about a better way to reproduce the progress/code-tracking behavior from computations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know; I don't hate it now.
If you don't explicitly use spans, you get something that somehow makes sense, at the cost of some mild non-determinism.
If you do use spans, everything is deterministic.

@hendrikmakait hendrikmakait merged commit 743826b into dask:main Jun 7, 2023
@crusaderky crusaderky deleted the spans/unique branch June 7, 2023 09:55
@crusaderky crusaderky mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants