pickfirstleaf: Fix shuffling of addresses in resolver updates without endpoints#8610
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8610 +/- ##
==========================================
+ Coverage 82.11% 82.16% +0.04%
==========================================
Files 415 415
Lines 40692 40697 +5
==========================================
+ Hits 33416 33439 +23
+ Misses 5887 5881 -6
+ Partials 1389 1377 -12
🚀 New features to boost your workflow:
|
easwars
approved these changes
Sep 25, 2025
| } | ||
|
|
||
| pfBuilder := balancer.Get(pfbalancer.Name) | ||
| shffleConfig, err := pfBuilder.(balancer.ConfigParser).ParseConfig(json.RawMessage(`{ "shuffleAddressList": true }`)) |
Contributor
There was a problem hiding this comment.
Lol, here and in the next statement, prefer adding the u back into shuffle. Saving one character in the variable name is not going to be very useful :)
Contributor
Author
There was a problem hiding this comment.
Changed to using complete words.
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| activeCfg := noShffleConfig |
Contributor
There was a problem hiding this comment.
Nit: remove this line since this assignment is anyways happening on line 521.
Contributor
Author
There was a problem hiding this comment.
Changed to only declaring the variable, but not initializing here.
arjan-bal
added a commit
to arjan-bal/grpc-go
that referenced
this pull request
Oct 1, 2025
… endpoints (grpc#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.
arjan-bal
added a commit
that referenced
this pull request
Oct 3, 2025
Original PRs: #8610, #8615 RELEASE NOTES: * balancer/pick_first: * Fix bug that can cause balancer to get stuck in `IDLE` state on backend address change. * 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.
Pranjali-2501
pushed a commit
to Pranjali-2501/grpc-go
that referenced
this pull request
Oct 6, 2025
… endpoints (grpc#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new
pick_first, which is the default, doesn't shuffle the addresses at all for resolver updates that are missing theEndpointsfield. This change fixes that. Since gRPC automatically sets the the missingEndpoints, occurrence of this bug should be uncommon in practice.RELEASE NOTES: