]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
pickfirstleaf: Fix shuffling of addresses in resolver updates without endpoints ...
authorArjan Singh Bal <46515553+arjan-bal@users.noreply.github.com>
Fri, 26 Sep 2025 05:38:27 +0000 (11:08 +0530)
committerGitHub <noreply@github.com>
Fri, 26 Sep 2025 05:38:27 +0000 (11:08 +0530)
commitbb71072094cf533965450c44890f8f51c671c393
treebd7bf880523c7d3a82b10b1d829987c7722fa25e
parent52287361c1702625d6e81efb7a8d1ac75783328a
pickfirstleaf: Fix shuffling of addresses in resolver updates without endpoints (#8610)

The new `pick_first`, which is the default, doesn't shuffle the
addresses at all for resolver updates that are missing the `Endpoints`
field. This change fixes that. Since [gRPC automatically sets the the
missing
`Endpoints`](https://github.com/grpc/grpc-go/blob/1059e84f885bf7ed65b3b1a4fbe914360d8ab5b1/resolver_wrapper.go#L136-L138),
occurrence of this bug should be uncommon in practice.

RELEASE NOTES:
* balancer/pick_first: When configured, shuffle addresses in resolver
updates that lack endpoints. Since gRPC automatically adds endpoints to
resolver updates, this bug should only affect implementers of custom LB
policies that use pick_first for delegation but don't forward the
endpoints.
balancer/pickfirst/pickfirst.go
balancer/pickfirst/pickfirst_ext_test.go
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go