Browse Source

clientv3: reset unhealthy on updateAddrs

Otherwise, 'mayPin' incorrectly decides if an address
should be pinned or not.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 years ago
parent
commit
500c2499f4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      clientv3/health_balancer.go

+ 1 - 0
clientv3/health_balancer.go

@@ -120,6 +120,7 @@ func (hb *healthBalancer) updateAddrs(eps ...string) {
 	addrs, host2ep := eps2addrs(eps), getHost2ep(eps)
 	addrs, host2ep := eps2addrs(eps), getHost2ep(eps)
 	hb.mu.Lock()
 	hb.mu.Lock()
 	hb.addrs, hb.eps, hb.host2ep = addrs, eps, host2ep
 	hb.addrs, hb.eps, hb.host2ep = addrs, eps, host2ep
+	hb.unhealthy = make(map[string]time.Time)
 	hb.mu.Unlock()
 	hb.mu.Unlock()
 	hb.balancer.updateAddrs(eps...)
 	hb.balancer.updateAddrs(eps...)
 }
 }