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

Refactor release key #5507

Merged
merged 3 commits into from
Nov 18, 2021
Merged

Refactor release key #5507

merged 3 commits into from
Nov 18, 2021

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Nov 9, 2021

This might fix #5482

This is mostly a refactoring around the release key implementation (which is historically easily top3 contributor for deadlocks). It is now more streamlined and all release and propagate forgotten logic is now pulled together into transition_generic_released and transition_released_forgotten where it should be. Worker.release_key now basically merely performs a state reset, as it is intended. Transition logic and recommendation should be as compact as possible to make reasoning more easy.

I also removed a few places were we set a recommendation to "forgotten" without actual reason. The new logic is now more stable and should fix #5482 and goes as

If a Task is released and does not have any dependents it is allowed to be forgotten

It's hard to tell since it's been spread across the state machine but the previous condition was much more loosely defined.

I'll try reproducing #5482 and write a test for it...

@fjetter
Copy link
Member Author

fjetter commented Nov 18, 2021

The deadlock itself should be fixed by #5525

I recommend merging this anyhow since it reduces complexity

@fjetter fjetter marked this pull request as ready for review November 18, 2021 17:24
@jrbourbeau jrbourbeau mentioned this pull request Nov 18, 2021
3 tasks
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

Offline @fjetter mentioned he is confident in the changes here and would be good to include them in the upcoming release (xref dask/community#206). To that end, I'm planning to merge this PR in a bit if there are no further comments

@jrbourbeau jrbourbeau merged commit 1721d62 into dask:main Nov 18, 2021
@fjetter fjetter deleted the refactor_release_key branch November 19, 2021 11:22
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.

KeyError in Worker.handle_compute_task (causes deadlock)
2 participants