Commit 6b014ac6 authored by TousakaRin's avatar TousakaRin

bug fix: In short/pooled mode, the data feedback for circuit_breaker will be wrong.

parent d8893d43
......@@ -761,6 +761,7 @@ void Controller::Call::OnComplete(
}
break;
}
if (ELOGOFF == error_code) {
SocketUniquePtr sock;
if (Socket::Address(peer_id, &sock) == 0) {
......@@ -768,7 +769,7 @@ void Controller::Call::OnComplete(
sock->SetLogOff();
}
}
if (need_feedback) {
const LoadBalancer::CallInfo info =
{ begin_time_us, peer_id, error_code, c };
......
......@@ -834,7 +834,6 @@ int Socket::SetFailed(int error_code, const char* error_fmt, ...) {
vref, MakeVRef(id_ver + 1, NRefOfVRef(vref)),
butil::memory_order_release,
butil::memory_order_relaxed)) {
GetOrNewSharedPart()->circuit_breaker.MarkAsBroken();
// Update _error_text
std::string error_text;
if (error_fmt != NULL) {
......@@ -852,6 +851,7 @@ int Socket::SetFailed(int error_code, const char* error_fmt, ...) {
// by Channel to revive never-connected socket when server side
// comes online.
if (_health_check_interval_s > 0) {
GetOrNewSharedPart( )->circuit_breaker.MarkAsBroken();
PeriodicTaskManager::StartTaskAt(
new HealthCheckTask(id()),
butil::milliseconds_from_now(GetOrNewSharedPart()->
......
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