don't apply defaultSC upon receipt of invalid service config (#5257)

This commit is contained in:
Easwar Swaminathan
2022-03-22 08:50:50 -07:00
committed by GitHub
parent 51ddcbad16
commit 597e5d1b1a
5 changed files with 288 additions and 102 deletions

View File

@ -653,13 +653,11 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error {
} else {
ret = balancer.ErrBadResolverState
if cc.sc == nil {
if cc.dopts.defaultServiceConfig != nil {
cc.applyServiceConfigAndBalancer(cc.dopts.defaultServiceConfig, &defaultConfigSelector{cc.dopts.defaultServiceConfig}, s.Addresses)
} else {
cc.applyFailingLB(s.ServiceConfig)
cc.mu.Unlock()
return ret
}
// Apply the failing LB only if we haven't received valid service config
// from the name resolver in the past.
cc.applyFailingLB(s.ServiceConfig)
cc.mu.Unlock()
return ret
}
}
}