Repository navigation
core: Fix pick_first stalls on address update while connecting - #13210
Merged
Merged
Conversation
shivaspeaks
marked this pull request as ready for review
November 30, 2026 05:13
Member
Author
|
CC: @kannanjgithub |
kannanjgithub
approved these changes
Nov 30, 2026
AgraVator
approved these changes
Nov 30, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#13209 stopped pick_first from starting the Connection Attempt Delay timer for the last address in the list. However, if an address update arrives while connecting and still contains the address being attempted,
acceptResolvedAddresses()keeps that attempt and returns early without scheduling a timer. Before #13209, the extra timer on the last address covered this case.As a result, when the list grew past the address being attempted (for example, [A0] -> [A0, A1]), the new addresses were not attempted until the current attempt failed. For a blackholed address, that can take the full connect timeout.
Start the timer in that path when CONNECTING, as gRFC A61 does for a subchannel that is already CONNECTING and is not the last in the list.
scheduleNextConnection()already does nothing if Happy Eyeballs is disabled, there is no next address, or a timer is pending. The READY case, which also takes that path, is unchanged.That path also skips any new addresses in front of the kept attempt. They are only tried once the walk reaches the end of the list and starts over from the beginning.
processSubchannelState()does that when the current subchannel fails on the last address, butrequestConnection()did not when skipping TRANSIENT_FAILURE subchannels moved it past the end.The index was then left invalid, so later failures were ignored and
isPassComplete()could never be true. With Happy Eyeballs enabled, the LB stayed in CONNECTING without trying the skipped addresses or requesting re-resolution. For example, with subchannels {C: TRANSIENT_FAILURE, B: CONNECTING} and an update to [D, B, C], moving from B to C (by the timer above, or by B failing) went past the end and D was never attempted. This predates #13209.Start over from the beginning in
requestConnection()too, when some addresses don't have a subchannel yet.cl/1031755943