-
Notifications
You must be signed in to change notification settings - Fork 529
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
Return Canceled
when a LabelNames
or LabelValues
request to a store-gateway is cancelled by the caller, and return Internal
otherwise for all requests.
#4061
Conversation
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.
The changes LGTM!
I've opened this as a draft because the tests that I've added in this PR currently fail ~50% of the time due to a race here where the context cancellation competes with the loading of expanded postings. I can't find a nice way to make these tests robust - would love some suggestions.
An option is to hit the context canceled in a different path. For example, you could configure the store WithIndexCache()
and pass an implementation which returns the context.Canceled
error. This way you don't have to directly pass a canceled context to the LabelNames()
function itself.
Good idea. Unfortunately, we log + ignore errors from caches, so the best other place to do this seems to be in the object storage implementation, which is what I've done here. I'm wondering whether it makes sense to modify |
7c88733
to
3b1cb43
Compare
Would be a cleaner solution. Let's try to offer the upstream change to |
I've raised thanos-io/objstore#43, let's see what they think. |
thanos-io/objstore#43 has been merged 🎉. Once #4136 is merged, I'll update this PR to take advantage of it. |
…ateway is cancelled by the caller, and return Internal otherwise. See #4007 for explanation.
3b1cb43
to
94b0b7c
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.
Nice, thanks!
What this PR does
See #4007 for background.
Which issue(s) this PR fixes or relates to
Follow on from #4007.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]