-
Notifications
You must be signed in to change notification settings - Fork 285
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
Move unlock call to a background context in GC #2198
Conversation
8b33ada
to
cfc3e7e
Compare
20c8720
to
780f704
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment for my own edification, LGTM
780f704
to
b1ceb39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
216010f
to
013f1ab
Compare
internal/datastore/common/gc.go
Outdated
err := gc.UnlockAfterGCRun(ctx) | ||
// NOTE: this uses a separate context to run the DB unlock logic, ensuring that | ||
// a timeout in the parent context won't prevent a lock release. | ||
err := gc.UnlockAfterGCRun(context.Background()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be clearer?
err := gc.UnlockAfterGCRun()
and then the implementations for the datastores can handle it as appropriate (i.e. it may make sense to have an internal timeout and kill the session)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it is clearer (as a caller I'd expect a context), but I can document it
This ensures that if the GC operation times out, the unlock still can run
013f1ab
to
e06fd9f
Compare
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This ensures that if the GC operation times out, the unlock still can run