Skip to content

Commit 93d4c6d

Browse files
committed
Describe behavior of the 'pick_first' strategy used on 'loadBalancingConfig'
1 parent efebeef commit 93d4c6d

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
@@ -500,6 +500,11 @@ func setupCrossSporkClient(config config.Config, logger zerolog.Logger) (*reques
500500
mr := manual.NewBuilderWithScheme("dns")
501501
defer mr.Close()
502502

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

0 commit comments

Comments
 (0)