-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,16 @@ func (c *ServiceRequestsCounter) StartRequest() error { | |
func (c *ServiceRequestsCounter) EndRequest() { | ||
atomic.AddUint32(&c.numRequests, ^uint32(0)) | ||
} | ||
|
||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. Should this return an error if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this doesn't matter. |
||
src.mu.Lock() | ||
defer src.mu.Unlock() | ||
c, ok := src.services[serviceName] | ||
if !ok { | ||
return | ||
} | ||
c.maxRequests = defaultMaxRequests | ||
c.numRequests = 0 | ||
} |
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.