-
Notifications
You must be signed in to change notification settings - Fork 81
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
metrics: don't increment objstore_bucket_operation_failures_total
if context cancelled while reading
#117
metrics: don't increment objstore_bucket_operation_failures_total
if context cancelled while reading
#117
Conversation
objstore_bucket_operation_failures_total
if context cancelled while readingobjstore_bucket_operation_failures_total
if context cancelled while reading
Signed-off-by: Charles Korn <[email protected]>
Signed-off-by: Charles Korn <[email protected]>
Signed-off-by: Charles Korn <[email protected]>
Signed-off-by: Charles Korn <[email protected]>
b92b4ef
to
374a7dc
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.
Couldn't we get the same by marking canceled context as expected error?
Yes. However, cancelled context is currently treated as a special case everywhere else that checks for expected errors (eg. here and here), so this PR makes reading an object consistent with that. We could remove all the special checks for context cancellation, but that would then be a change in current behaviour for all consumers of this library. |
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 (modulo a minor comment)
Signed-off-by: Charles Korn <[email protected]>
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
Isn't this actually hiding an error? If the initial s3 read that we do to check for 404 fails because of connection issue we don't get timing or error metrics |
Changes
This PR fixes an issue where the
objstore_bucket_operation_failures_total
metric is incremented if the context is cancelled while reading an object from a bucket but after theGet
orGetRange
method has returned.This makes the behaviour consistent with other operations, and makes the behaviour consistent with a cancellation that occurs while
Get
orGetRange
is executing.Verification
I have added unit tests to cover this scenario.