-
Notifications
You must be signed in to change notification settings - Fork 812
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
query-frontend: do not log error if context is canceled #4562
Conversation
My Thanos instance is spamming this whenever the user cancels a query that is being executed: ``` {"caller":"retry.go:73","err":"context canceled","level":"error","msg":"error processing request","org_id":"anonymous","try":0,"ts":"2021-11-23T13:35:09.275914072Z"} ``` It doesn't mean anything bad so let's stop the spam. Thus, do not perform the retrying logic if the context has been canceled. Later on this is handled in: ```go resp, err := f.roundTripper.RoundTrip(r) queryResponseTime := time.Since(startTime) if err != nil { writeError(w, err) return } ``` Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
205ef1d
to
a255d5c
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.
Thank you.
Signed-off-by: Giedrius Statkevičius <[email protected]>
Unit tests pass locally just fine, I assume it's the same with integration tests ( |
I believe this line means it did not retry: cortex/pkg/querier/queryrange/retry.go Lines 61 to 62 in 4e9fc3a
However I agree with you about not logging a cancellation as an error. I might prefer to have the same if-condition in both cases, rather than introducing the new |
Sorry, I was a bit busy. I can change it if you want to 👍 |
…#4562) * query-frontend: do not log error if context is canceled Example whenever the user cancels a query that is being executed: ``` {"caller":"retry.go:73","err":"context canceled","level":"error","msg":"error processing request","org_id":"anonymous","try":0,"ts":"2021-11-23T13:35:09.275914072Z"} ``` It doesn't mean anything bad so let's stop the spam. Signed-off-by: Giedrius Statkevičius <[email protected]> Signed-off-by: Alvin Lin <[email protected]>
What this PR does:
My Thanos instance is spamming this whenever the user cancels a query
that is being executed:
It doesn't mean anything bad so let's stop the spam. Thus, do not perform the
retrying logic if the context has been canceled. Later on this is handled in:
Which issue(s) this PR fixes:
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]