Commit 8a000838 authored by zhujiashun's avatar zhujiashun

health_check_using_rpc: fix UT

parent 74951b9d
...@@ -556,7 +556,7 @@ int Channel::Weight() { ...@@ -556,7 +556,7 @@ int Channel::Weight() {
int Channel::CheckHealth() { int Channel::CheckHealth() {
if (_lb == NULL) { if (_lb == NULL) {
SocketUniquePtr ptr; SocketUniquePtr ptr;
if (Socket::Address(_server_id, &ptr) == 0 && !ptr->IsAvailable()) { if (Socket::Address(_server_id, &ptr) == 0 && ptr->IsAvailable()) {
return 0; return 0;
} }
return -1; return -1;
......
...@@ -180,7 +180,7 @@ int WeightedRoundRobinLoadBalancer::SelectServer(const SelectIn& in, SelectOut* ...@@ -180,7 +180,7 @@ int WeightedRoundRobinLoadBalancer::SelectServer(const SelectIn& in, SelectOut*
SocketId server_id = GetServerInNextStride(s->server_list, filter, tls_temp); SocketId server_id = GetServerInNextStride(s->server_list, filter, tls_temp);
if (!ExcludedServers::IsExcluded(in.excluded, server_id) if (!ExcludedServers::IsExcluded(in.excluded, server_id)
&& Socket::Address(server_id, out->ptr) == 0 && Socket::Address(server_id, out->ptr) == 0
&& !(*out->ptr)->IsAvailable()) { && (*out->ptr)->IsAvailable()) {
// update tls. // update tls.
tls.remain_server = tls_temp.remain_server; tls.remain_server = tls_temp.remain_server;
tls.position = tls_temp.position; tls.position = tls_temp.position;
......
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