Revert "grpc: call balancer.Close() before returning from ccBalancerWrapper.close()" (#4391)
This reverts commit 28078834f3
.
This commit is contained in:
Родитель
d2d6bdae07
Коммит
cb396472c2
|
@ -69,10 +69,10 @@ func (ccb *ccBalancerWrapper) watcher() {
|
|||
select {
|
||||
case t := <-ccb.scBuffer.Get():
|
||||
ccb.scBuffer.Load()
|
||||
ccb.balancerMu.Lock()
|
||||
if ccb.done.HasFired() {
|
||||
break
|
||||
}
|
||||
ccb.balancerMu.Lock()
|
||||
su := t.(*scStateUpdate)
|
||||
ccb.balancer.UpdateSubConnState(su.sc, balancer.SubConnState{ConnectivityState: su.state, ConnectionError: su.err})
|
||||
ccb.balancerMu.Unlock()
|
||||
|
@ -80,6 +80,7 @@ func (ccb *ccBalancerWrapper) watcher() {
|
|||
}
|
||||
|
||||
if ccb.done.HasFired() {
|
||||
ccb.balancer.Close()
|
||||
ccb.mu.Lock()
|
||||
scs := ccb.subConns
|
||||
ccb.subConns = nil
|
||||
|
@ -94,9 +95,6 @@ func (ccb *ccBalancerWrapper) watcher() {
|
|||
}
|
||||
|
||||
func (ccb *ccBalancerWrapper) close() {
|
||||
ccb.balancerMu.Lock()
|
||||
defer ccb.balancerMu.Unlock()
|
||||
ccb.balancer.Close()
|
||||
ccb.done.Fire()
|
||||
}
|
||||
|
||||
|
@ -121,19 +119,13 @@ func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s co
|
|||
func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error {
|
||||
ccb.balancerMu.Lock()
|
||||
defer ccb.balancerMu.Unlock()
|
||||
if ccb.done.HasFired() {
|
||||
return nil
|
||||
}
|
||||
return ccb.balancer.UpdateClientConnState(*ccs)
|
||||
}
|
||||
|
||||
func (ccb *ccBalancerWrapper) resolverError(err error) {
|
||||
ccb.balancerMu.Lock()
|
||||
defer ccb.balancerMu.Unlock()
|
||||
if ccb.done.HasFired() {
|
||||
return
|
||||
}
|
||||
ccb.balancer.ResolverError(err)
|
||||
ccb.balancerMu.Unlock()
|
||||
}
|
||||
|
||||
func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче