MCPcopy
hub / github.com/grpc/grpc-go / ExitIdle

Method ExitIdle

balancer/lazy/lazy.go:124–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124func (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.

Callers 1

NewBalancerFunction · 0.95

Calls 7

ExitIdleMethod · 0.65
UpdateClientConnStateMethod · 0.65
ResolveNowMethod · 0.65
WarningfMethod · 0.65
ResolverErrorMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected