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

Ensure tokens on futures are unique #8569

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Mar 11, 2024

This would be the simplest approach to fix #8561

There was a test that asserted on this behavior but I believe this is not an issue.

@hendrikmakait hendrikmakait self-requested a review March 11, 2024 13:55
Copy link
Contributor

@milesgranger milesgranger left a comment

Choose a reason for hiding this comment

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

Can't speak for any potential repercussions of the changed test assertion, but the implementation here looks good to me. 👍

@crusaderky crusaderky self-requested a review March 11, 2024 13:59
Copy link
Contributor

Unit Test Results

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

    27 files  ± 0      27 suites  ±0   10h 1m 45s ⏱️ + 8m 0s
 4 050 tests ± 0   3 937 ✅  -  1    110 💤 ±0  3 ❌ +1 
50 854 runs  +18  48 517 ✅ +32  2 334 💤  - 6  3 ❌  - 8 

For more details on these failures, see this check.

Results for commit 8d096fd. ± Comparison against base commit 0438768.

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, @fjetter! This looks reasonable to me.

return Future.make_future, (self.key, self._id)

def __dask_tokenize__(self):
return (type(self).__name__, self.key, self._id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return (type(self).__name__, self.key, self._id)
return (normalize_token(type(self)), self.key, self._id)

nit - mostly in case a third party subclasses distributed.Future without changing the name


c.futures[x.key].finish()

assert tok == tokenize(y)
assert tok != tokenize(y)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert tok != tokenize(y)

nit: redundant with the test above

@@ -863,11 +863,13 @@ async def test_tokenize_on_futures(c, s, a, b):
y = c.submit(inc, 1)
tok = tokenize(x)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tok = tokenize(x)

Copy link
Collaborator

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

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

Very minor nits as far as the code is concerned.
I'd like to have a read through the object deduplication code you mentioned in the issue before approving, if possible.

@fjetter
Copy link
Member Author

fjetter commented Mar 11, 2024

The object dedup was introduced here dask/dask-expr#798 but I will move forward with this now.

@fjetter fjetter merged commit 8a1ecb8 into dask:main Mar 11, 2024
30 of 35 checks passed
@fjetter fjetter deleted the tokenize_future branch March 11, 2024 17:34
milesgranger pushed a commit to milesgranger/distributed that referenced this pull request Mar 13, 2024
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.

test_dask_collections.py::test_dataframe_set_index_sync passes locally, fails on CI
4 participants