Skip to content
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

[Access] Circuit breaker too restrictive #5010

Merged
19 changes: 19 additions & 0 deletions engine/access/rpc/connection/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,25 @@ func (m *Manager) createCircuitBreakerInterceptor() grpc.UnaryClientInterceptor
// MaxRequests defines the max number of concurrent requests while the circuit breaker is in the HalfClosed
// state.
MaxRequests: m.circuitBreakerConfig.MaxRequests,
// IsSuccessful defines gRPC status codes that should be treated as a successful result for the circuit breaker.
IsSuccessful: func(err error) bool {
if se, ok := status.FromError(err); ok {
if se == nil {
return true
}

// There are several error cases that may occur during normal operation and should be considered
// as "successful" from the perspective of the circuit breaker.
return se.Code() == codes.OK ||
Guitarheroua marked this conversation as resolved.
Show resolved Hide resolved
se.Code() == codes.Canceled ||
se.Code() == codes.InvalidArgument ||
se.Code() == codes.NotFound ||
se.Code() == codes.Unimplemented ||
se.Code() == codes.OutOfRange
}

return false
},
})

circuitBreakerInterceptor := func(
Expand Down
Loading