{{ message }}
Repository navigation
xds: Fix intermittent failure in RingHashLoadBalancerTest.allSubchannelsInTransientFailure - #13130
Open
kannanjgithub wants to merge 1 commit into
Open
kannanjgithub wants to merge 1 commit into
kannanjgithub wants to merge 1 commit into
Conversation
…elsInTransientFailure Deliver TRANSIENT_FAILURE in deterministic server order using subchannelList instead of iterating over subchannels.values() (HashMap), and expect 2 connections. Why this became flaky with the new PickFirst LB: Old PickFirst unconditionally invoked subchannel.requestConnection() on each call without checking connection state, so triggering proactive connections twice always produced 2 connection requests regardless of iteration order (either [A, B] or [A, A]). New PickFirst deduplicates connection requests if a subchannel is already in CONNECTING state. When iterating over a HashMap, if the same subchannel was triggered twice, New PickFirst deduplicated it to 1 connection, leading to the assumption in grpc#13094 that New PickFirst would always yield 1 connection. However, if two distinct subchannels were triggered (e.g. server1 then server2), New PickFirst does not deduplicate and yields 2 connections, causing verifyConnection(1) to fail intermittently. Fix this by iterating deterministically in server order, which reliably triggers two distinct subchannels (server1 and server2) in both old and new PickFirst. TAG=agy CONV=d59ec8a0-3bb7-41f8-bb11-76e843a2dada
This branch has not been deployed
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.

Deliver TRANSIENT_FAILURE in deterministic server order using subchannelList instead of iterating over subchannels.values() (HashMap), and expect 2 connections.
Why this became flaky with the new PickFirst LB:
Old PickFirst unconditionally invoked subchannel.requestConnection() on each call without checking connection state, so triggering proactive connections twice always produced 2 connection requests regardless of iteration order (either [A, B] or [A, A]).
New PickFirst deduplicates connection requests if a subchannel is already in CONNECTING state. When iterating over a HashMap, if the same subchannel was triggered twice, New PickFirst deduplicated it to 1 connection, leading to the assumption in #13094 that New PickFirst would always yield 1 connection. However, if two distinct subchannels were triggered (e.g. server1 then server2), New PickFirst does not deduplicate and yields 2 connections, causing verifyConnection(1) to fail intermittently.
Fix this by iterating deterministically in server order, which reliably triggers two distinct subchannels (server1 and server2) in both old and new PickFirst.
Failure test run in fusion2/d9446b33-dc0e-4dee-b901-ea9b3b57f3c6