jamesge commented on a change in pull request #1005: ignore ELIMIT for circuit
breaker
URL: https://github.com/apache/incubator-brpc/pull/1005#discussion_r368792573
##########
File path: src/brpc/circuit_breaker.cpp
##########
@@ -172,6 +178,16 @@ CircuitBreaker::CircuitBreaker()
}
bool CircuitBreaker::OnCallEnd(int error_code, int64_t latency) {
+ // If the server has reached its maximum concurrency, it will return
+ // ELIMIT directly when a new request arrives. This usually means that
+ // the entire downstream cluster is overloaded. If we isolate nodes at
+ // this time, may increase the pressure on downstream. On the other hand,
+ // since the latency corresponding to ELIMIT is usually very small, we
+ // cannot handle it as a successful request.Here we simply ignore the
requests
+ // that returns ELIMIT.
+ if (error_code == ELIMIT) {
+ return true;
Review comment:
缩进不对
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]