Notify parent ClientConn to re-resolve in grpclb (#1699)

The parent ClientConn should re-resolve when grpclb loses connection to the
remote balancer.

When the ClientConn inside grpclb gets a TransientFailure, it calls
lbManualResolver.ResolveNow(), which calls parent ClientConn's ResolveNow, and
eventually results in re-resolve happening in parent ClientConn's resolver (DNS
for example).

This PR adds a method to balancer.ClientConn interface, so balancer can tell
parent ClientConn to re-resolve.
This commit is contained in:
Menghan Li
2017-12-18 15:36:55 -08:00
committed by GitHub
parent e6549e636d
commit 0547980095
4 changed files with 99 additions and 3 deletions

View File

@ -109,6 +109,9 @@ type ClientConn interface {
// on the new picker to pick new SubConn.
UpdateBalancerState(s connectivity.State, p Picker)
// ResolveNow is called by balancer to notify gRPC to do a name resolving.
ResolveNow(resolver.ResolveNowOption)
// Target returns the dial target for this ClientConn.
Target() string
}