-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Throttler: CheckThrottlerResponseCode
to replace HTTP status codes
#16491
Throttler: CheckThrottlerResponseCode
to replace HTTP status codes
#16491
Conversation
…tApp Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
CheckThrottlerResponseCode
to replace HTTP status codes
Seeing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16491 +/- ##
==========================================
+ Coverage 68.62% 68.63% +0.01%
==========================================
Files 1551 1551
Lines 199515 199555 +40
==========================================
+ Hits 136915 136970 +55
+ Misses 62600 62585 -15 ☔ View full report in Codecov by Sentry. |
An unrelated artifact fetching error. Good to go. |
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.
❤️
if resp.StatusCode == http.StatusInternalServerError { | ||
throttleMetric.Err = fmt.Errorf("Status code: %d", resp.StatusCode) | ||
throttleMetric.Err = fmt.Errorf("status code: %d", resp.StatusCode) | ||
} |
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.
Should this be an else if
? I wouldn't think we'd want the http code to override the response code for the error, but maybe we do.
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 two cpde blocks will behave identically. I intentionally separated to two separate if
s because for backwards compatibility sake, I must keep the old one, so adding as a separate block is "clean" diff-wise. In v22
we will remove that old one, and again the diff will be clean. WDYT?
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.
Sure, not a big deal at all.
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.
🚀
Description
This PR adds
CheckThrottlerResponseCode
as a more formalized/standard response code to replace the existing HTTP response codes.For now, and for
v21
, all checks return both HTTP response codes andCheckThrottlerResponseCode
, and both are tested. Of course,v20
(and below) servers only return HTTP response codes.In
v22
or later we can get rid of the HTTPStatusCode
fields used throughout the code and any associated functionality.Related Issue(s)
Checklist
Deployment Notes