Просмотр исходного кода

Merge pull request #8674 from gyuho/set-endpoints

clientv3: reset unhealthy on updateAddrs
Gyu-Ho Lee 8 лет назад
Родитель
Сommit
bc03ce9cab
1 измененных файлов с 1 добавлено и 0 удалено
  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)
 	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...)
 }