feat(tonic-xds): drive gRPC retry config from LDS control-plane updates - #2786
Open
LYZJU2019 wants to merge 1 commit into
Open
feat(tonic-xds): drive gRPC retry config from LDS control-plane updates#2786LYZJU2019 wants to merge 1 commit into
LYZJU2019 wants to merge 1 commit into
Conversation
Wire the gRPC channel's retry configuration to the control plane so retry behavior tracks LDS (Listener) updates without rebuilding the channel. - Preserve listener-level `metadata` on `ListenerResource` (reusing the generic `RouteConfigMetadata` wrapper over `envoy…v3.Metadata`). - Surface the active Listener from the cache via `watch_listener()`, pushed by the LDS handler in the resource manager. - Add `XdsChannelBuilder::with_retry_config_from_metadata`, a seam that takes a `Fn(&RouteConfigMetadata) -> Option<RetryConfig>` closure. A background task applies it on every Listener update and hot-swaps the result into the retry policy's shared config (`Arc<ArcSwap<RetryConfig>>`); `None` keeps the previous config. The task handle is an `AbortOnDrop` tied to channel lifetime. When no extractor is registered, the channel keeps today's fixed default retry config with no watch task. - Re-export `RetryConfig` and `RetryBackoffConfig` so callers can build the config returned from the extractor. The LinkedIn-specific D2 metadata parsing lives in the caller's closure; OSS provides only the wiring.
LYZJU2019
force-pushed
the
lyzju2019/xds-transport-channel
branch
from
July 31, 2026 19:13
99cfc82 to
bf14624
Compare
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.
What
Wire the gRPC channel's retry config to the control plane so retry behavior tracks LDS (Listener) updates without rebuilding the channel.
Previously the gRPC channel used a fixed
GrpcRetryPolicy::default(). This PR adds a seam so a caller can drive the retry config from the Listener metadata delivered by the control plane, hot-swapping it on every update.Testing
retry_config_hot_swaps_from_listener_metadata: publishes a Listenerand asserts the policy's
num_retrieshot-swaps1 -> 3.fmt --check, build (default +tls-ring,testutil,-D warnings),test(400 tests + 4 doctests),doc(default +tls-ring,-D warnings), clippy,and
check-external-types --all-featuresall pass.