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

Unlock redsync locks using context.Background() #1578

Closed

Conversation

glindstedt
Copy link

What this PR does / Why we need it:

Context: #1576

We observed an issue where CleanupBackfills would leave backfill mutex locks in a locked state if the context was canceled, which prevented us from doing anything with the backfill until the backfillLockTimeout. Even if the backfill had expired we had to wait for the timeout to find out about it.

This PR ensures that the deferred Unlock is performed using a background context, so if the original context was canceled we will still try to unlock the mutex.

Which issue(s) this PR fixes:

Closes #1576

Special notes for your reviewer:

If using the same context that was passed in from the original call,
there's a risk that the context has been canceled. This would cause the
Unlock operation to fail and leave the lock in a locked state.
@joeholley
Copy link
Collaborator

Note: Backfills is a community-contributed feature, so we just merge PRs related to it into the next version provided tests pass and there's no obvious issues with the code.

This will be in 1.8. Thanks for the contribution!

@joeholley joeholley added this to the v1.8.0 milestone Jun 19, 2023
@joeholley
Copy link
Collaborator

Manually merged into release-1.8 branch commit 74d84a2

@joeholley joeholley closed this Aug 17, 2023
@joeholley joeholley mentioned this pull request Aug 17, 2023
@joeholley joeholley mentioned this pull request Sep 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.

Backfill mutex not unlocked when context is canceled in CleanupBackfills
2 participants