Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc: do not apply default service config upon receipt of invalid service config #5257

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions clientconn.go
Expand Up @@ -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
}
}
}
Expand Down
94 changes: 0 additions & 94 deletions resolver_conn_wrapper_test.go

This file was deleted.

3 changes: 3 additions & 0 deletions service_config.go
Expand Up @@ -381,6 +381,9 @@ func init() {
//
// If any of them is NOT *ServiceConfig, return false.
func equalServiceConfig(a, b serviceconfig.Config) bool {
if a == nil && b == nil {
return true
}
aa, ok := a.(*ServiceConfig)
if !ok {
return false
Expand Down
1 change: 0 additions & 1 deletion test/resolver_test.go → test/config_selector_test.go
Expand Up @@ -211,5 +211,4 @@ func (s) TestConfigSelector(t *testing.T) {
}
})
}

}