From 500c2499f4917dcc80a9da719831096828c6fc3e Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Tue, 10 Oct 2017 12:28:57 -0700 Subject: [PATCH] clientv3: reset unhealthy on updateAddrs Otherwise, 'mayPin' incorrectly decides if an address should be pinned or not. Signed-off-by: Gyu-Ho Lee --- clientv3/health_balancer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/clientv3/health_balancer.go b/clientv3/health_balancer.go index 6f01c25f6..dd4958c80 100644 --- a/clientv3/health_balancer.go +++ b/clientv3/health_balancer.go @@ -120,6 +120,7 @@ func (hb *healthBalancer) updateAddrs(eps ...string) { addrs, host2ep := eps2addrs(eps), getHost2ep(eps) hb.mu.Lock() hb.addrs, hb.eps, hb.host2ep = addrs, eps, host2ep + hb.unhealthy = make(map[string]time.Time) hb.mu.Unlock() hb.balancer.updateAddrs(eps...) }