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)