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

RetireWorker policy is done if removed #6234

Merged
merged 4 commits into from
Apr 28, 2022

Conversation

gjoseph92
Copy link
Collaborator

Closes #6223, using the fix discussed in #6223 (comment).

This eliminates the race condition where:

  • RetireWorker AMM policy completes (all keys have been moved off the worker), so it removes itself from the AMM policies—done() is true at this moment.
  • By the time _track_retire_worker awakens, new keys have shown up on the worker, so RetireWorker.done() is now False
  • Because the policy was removed, nothing will remove those keys, so the while not policy.done() loop runs forever.

Now, we say the policy is also done if it's been removed.

I'm still working on a test, but hopefully @bnaul can confirm whether this seems to resolve the problem.

  • Tests added / passed
  • Passes pre-commit run --all-files

@gjoseph92 gjoseph92 mentioned this pull request Apr 28, 2022
2 tasks
@gjoseph92 gjoseph92 marked this pull request as ready for review April 28, 2022 20:18
`test_RetireWorker_no_recipients` and `test_RetireWorker_all_recipients_are_paused` were failling withou this.
@gjoseph92
Copy link
Collaborator Author

This actually caused a bug, fixed in e95fdba. Thanks for the great tests that caught this @crusaderky!

Added a test for this change in a separate PR: #6240. I think the test will take longer to get in, but I believe we're confident in this change and would like to get it in the release.

@gjoseph92 gjoseph92 requested a review from crusaderky April 28, 2022 20:32
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.

Worker stuck in closing_gracefully state
2 participants