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 reconnecting workers do not loose required data #5436

Merged
merged 3 commits into from
Oct 18, 2021

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Oct 18, 2021

Again a deadlock masked by mark.repeat flags. We should be more careful with these flags. This time, at least, this showed up as AssertionErrors in tests

If a worker briefly disconnects it has the chance to register what tasks it already has in memory and is currently executing. If it has data which is already released, it is also asked to release this. However, this introduces a subtle race condition where the worker is asked to release all it's data although we simultaneously would expect him to compute that keys dependent. Therefore, we should use the safe handler (remove-replica) instead of the strict handler (free-keys). See comment below for the proper section.

I took this chance to clean up the signature around free-keys to be in alignment with the rest

@@ -4339,9 +4343,9 @@ async def add_worker(
worker_msgs[address] = []
worker_msgs[address].append(
{
"op": "free-keys",
"op": "remove-replicas",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the relevant change

@fjetter fjetter requested a review from crusaderky October 18, 2021 12:56
@fjetter fjetter merged commit 7d2516a into dask:main Oct 18, 2021
@fjetter fjetter deleted the fix_flaky_reconnect_worker_tests branch October 18, 2021 17:16
zanieb pushed a commit to zanieb/distributed that referenced this pull request Oct 28, 2021
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