Unverified Commit 0f4a864b authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #551 from TousakaRin/circuit_breaker_bug_fix

CircuitBreaker_Bug_Fix
parents 4fec80cb 3589bea5
......@@ -696,6 +696,11 @@ inline bool does_error_affect_main_socket(int error_code) {
// entire RPC (specified by c->FailedInline()).
void Controller::Call::OnComplete(
Controller* c, int error_code/*note*/, bool responded, bool end_of_rpc) {
if (enable_circuit_breaker && sending_sock) {
sending_sock->FeedbackCircuitBreaker(error_code,
butil::gettimeofday_us() - begin_time_us);
}
switch (c->connection_type()) {
case CONNECTION_TYPE_UNKNOWN:
break;
......@@ -760,11 +765,7 @@ void Controller::Call::OnComplete(
sock->SetLogOff();
}
}
if (enable_circuit_breaker && sending_sock) {
sending_sock->FeedbackCircuitBreaker(error_code,
butil::gettimeofday_us() - begin_time_us);
}
if (need_feedback) {
const LoadBalancer::CallInfo info =
{ begin_time_us, peer_id, error_code, c };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment