diff --git a/common/thrift_client_pool.h b/common/thrift_client_pool.h index d903c7fe..6c558776 100644 --- a/common/thrift_client_pool.h +++ b/common/thrift_client_pool.h @@ -311,9 +311,15 @@ class ThriftClientPool { // won't keep a !good() channels for a long period of time. if (itor->second.first.use_count() == 0) { itor = channels_.erase(itor); - } else { - ++itor; + continue; + } + + auto c = itor->second.first.lock(); + if (c && !(itor->second.second->is_good.load())) { + c->closeNow(); } + + ++itor; } } }