Skip to content

Commit 5a6767b

Browse files
committed
Describe behavior of the 'pick_first' strategy used on 'loadBalancingConfig'
1 parent 626a9e2 commit 5a6767b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bootstrap/bootstrap.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ func setupCrossSporkClient(config config.Config, logger zerolog.Logger) (*reques
495495
mr := manual.NewBuilderWithScheme("dns")
496496
defer mr.Close()
497497

498+
// `pick_first` tries to connect to the first address, uses it for all RPCs
499+
// if it connects, or try the next address if it fails
500+
// (and keep doing that until one connection is successful).
501+
// Because of this, all the RPCs will be sent to the same backend. See more on:
502+
// https://github.com/grpc/grpc-go/tree/master/examples/features/load_balancing#pick_first
498503
json := `{"loadBalancingConfig": [{"pick_first":{}}]}`
499504
endpoints := []resolver.Endpoint{
500505
{Addresses: []resolver.Address{{Addr: config.AccessNodeHost}}},

0 commit comments

Comments
 (0)