-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
xds: report drops by circuit breaking #4171
xds: report drops by circuit breaking #4171
Conversation
Those drops will be reported to store with category "". When reported via LRS, they will only be counted in total_drops, but not in per category.
0b5c5c0
to
f063116
Compare
f063116
to
7baecdd
Compare
|
||
// ClearCounterForTesting clears the counter for the service. Should be only | ||
// used in tests. | ||
func ClearCounterForTesting(serviceName string) { |
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 return an error if serviceName
is not found in the map?
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.
I think this doesn't matter.
Or are you suggesting that we should fail the test if this cleanup can't find the counter?
// Drops by circuit breaking are reported with empty category. They | ||
// will be reported only in total drops, but not in per category. | ||
if d.loadStore != nil { | ||
d.loadStore.CallDropped("") |
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.
Why do we report these with an empty category instead of using a category which makes it clear that these calls were dropped because of circuit-breaking?
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.
This is defined in the design doc.
And I believe the reason behind is that envoy doesn't report those with category.
xds/internal/client/load/store.go
Outdated
if keyStr != "" { | ||
// Skip drops without category. They are counted in total_drops, but | ||
// not in per category. One example is drops by circuit breaking. | ||
sd.Drops[key.(string)] = d |
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.
keyStr
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.
Done
Those drops will be reported to store with category "". When reported via LRS,
they will only be counted in total_drops, but not in per category.
fixes #4138