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
pull/1664/head
Giovanny Gutiérrez 3 years ago committed by GitHub
parent 67161b62eb
commit 2471f1d955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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)

Loading…
Cancel
Save