New grpclb implementation (#1558)

The new grpclb supports fallback to backends if remote balancer is unavailable
This commit is contained in:
Menghan Li
2017-11-27 11:16:26 -08:00
committed by GitHub
parent 10873b30bf
commit 2ef021f78d
13 changed files with 1014 additions and 881 deletions

View File

@ -441,9 +441,7 @@ func recv(p *parser, c Codec, s *transport.Stream, dc Decompressor, m interface{
}
type rpcInfo struct {
failfast bool
bytesSent bool
bytesReceived bool
failfast bool
}
type rpcInfoContextKey struct{}
@ -457,14 +455,6 @@ func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) {
return
}
func updateRPCInfoInContext(ctx context.Context, s rpcInfo) {
if ss, ok := rpcInfoFromContext(ctx); ok {
ss.bytesReceived = s.bytesReceived
ss.bytesSent = s.bytesSent
}
return
}
// Code returns the error code for err if it was produced by the rpc system.
// Otherwise, it returns codes.Unknown.
//