From 2471f1d955c1c281dea76739dd9bf081e728ba8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giovanny=20Guti=C3=A9rrez?= Date: Fri, 3 Dec 2021 04:21:56 -0500 Subject: [PATCH] fix(grpc): Block the RCP unil a new picker is available (#1660) * fix(config): Support colon as default value in config.yaml * fix(cmd/protoc-gen-go-http): Follow the http rule to use the query string * fix: Block the RPC until new picker is available * fix: lints for balancer --- transport/grpc/balancer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport/grpc/balancer.go b/transport/grpc/balancer.go index 5731bb9ea..0181792df 100644 --- a/transport/grpc/balancer.go +++ b/transport/grpc/balancer.go @@ -49,6 +49,11 @@ type Builder struct { // Build creates a grpc Picker. func (b *Builder) Build(info base.PickerBuildInfo) gBalancer.Picker { + if len(info.ReadySCs) == 0 { + // Block the RPC until a new picker is available via UpdateState(). + return base.NewErrPicker(gBalancer.ErrNoSubConnAvailable) + } + nodes := make([]selector.Node, 0) for conn, info := range info.ReadySCs { ins, _ := info.Address.Attributes.Value("rawServiceInstance").(*registry.ServiceInstance)