()
| 122 | } |
| 123 | |
| 124 | func (lb *lazyBalancer) ExitIdle() { |
| 125 | lb.mu.Lock() |
| 126 | defer lb.mu.Unlock() |
| 127 | if lb.delegate != nil { |
| 128 | lb.delegate.ExitIdle() |
| 129 | return |
| 130 | } |
| 131 | lb.delegate = lb.childBuilder(lb.cc, lb.buildOptions) |
| 132 | if lb.latestClientConnState != nil { |
| 133 | if err := lb.delegate.UpdateClientConnState(*lb.latestClientConnState); err != nil { |
| 134 | if err == balancer.ErrBadResolverState { |
| 135 | lb.cc.ResolveNow(resolver.ResolveNowOptions{}) |
| 136 | } else { |
| 137 | lb.logger.Warningf("Error from child policy on receiving initial state: %v", err) |
| 138 | } |
| 139 | } |
| 140 | lb.latestClientConnState = nil |
| 141 | } |
| 142 | if lb.latestResolverError != nil { |
| 143 | lb.delegate.ResolverError(lb.latestResolverError) |
| 144 | lb.latestResolverError = nil |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // idlePicker is used when the SubConn is IDLE and kicks the SubConn into |
| 149 | // CONNECTING when Pick is called. |
no test coverage detected