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

resolver: add State fields to support error handling #2951

Merged
merged 14 commits into from
Oct 4, 2019
Prev Previous commit
Next Next commit
merge fixes
  • Loading branch information
dfawley committed Oct 4, 2019
commit a82da16e2d6eefec9a557a6c9bea777088f47315
7 changes: 5 additions & 2 deletions balancer_conn_wrappers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (b *funcBalancerBuilder) Build(balancer.ClientConn, balancer.BuildOptions)
}
func (b *funcBalancerBuilder) Name() string { return b.name }

// TestResolverErrorPolling injects balancer errors and verifies ResolveNow is
// TestBalancerErrorResolverPolling injects balancer errors and verifies ResolveNow is
// called on the resolver with the appropriate backoff strategy being consulted
// between ResolveNow calls.
func (s) TestBalancerErrorResolverPolling(t *testing.T) {
Expand Down Expand Up @@ -89,7 +89,10 @@ func (s) TestBalancerErrorResolverPolling(t *testing.T) {
}
balancer.Register(&funcBalancerBuilder{name: "BalancerErrorResolverPolling", instance: fb})

cc, err := Dial(r.Scheme()+":https:///test.server", WithInsecure(), WithBalancerName("BalancerErrorResolverPolling"))
cc, err := Dial(r.Scheme()+":https:///test.server", WithInsecure(), WithDefaultServiceConfig(`
{
"loadBalancingConfig": [{"BalancerErrorResolverPolling": {}}]
}`))
if err != nil {
t.Fatalf("Dial(_, _) = _, %v; want _, nil", err)
}
Expand Down
2 changes: 1 addition & 1 deletion service_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func parseServiceConfig(js string) *serviceconfig.Getter {
// case.
err := fmt.Errorf("invalid loadBalancingConfig: no supported policies found")
grpclog.Warningf(err.Error())
return nil, err
return serviceconfig.NewGetter(err)
}
}

Expand Down