xds-failover: adding main logic
Commit Message: xds-failover: adding main logic Additional Description: Adding the main logic for the xDS-failover support. It currently supports a primary and failover sources. Initially, the manager attempts to connect to the primary twice, and if both fail, alternates between the failover and the primary until one is successfully connected to. Once a connection is made (a response arrives) from either source, the failover manager will stick to that source.
Risk Level: low - not plumbed into any GrpcMux object yet. Testing: Added unit test. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
Harvey PTAL. LMK if you want more context (I've got an internal integration test the exercises this code). /assign @htuch
Assigning @soulxu as !Google maintainer reviewer. /assign @soulxu
Unassigning @soulxu as he is OOO this week. @wbpcode can you please take a ~Google pass at this PR?
@nezdolik will you have some bandwidth to review this PR as a !Google reviewer? Thanks in advance!
Thanks, exciting feature! There is also certain degree of code duplication across
FailoverGrpcStreamCallbacksandPrimaryGrpcStreamCallbacks, but is also fine to leave it as it is if refactoring is too much effort.
Thanks! I think that the primary and fallback will be quite different as we get to test this out and add some different behavior. We can always refactor the code later, making them extend the same class or something.
cc @htuch for final approval and merge