mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-14 02:33:03 +02:00
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
This commit is contained in:
parent
67161b62eb
commit
2471f1d955
@ -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…
Reference in New Issue
Block a user