Skip to content

feat(tonic-xds): drive gRPC retry config from LDS control-plane updates - #2786

Open
LYZJU2019 wants to merge 1 commit into
grpc:masterfrom
LYZJU2019:lyzju2019/xds-transport-channel
Open

feat(tonic-xds): drive gRPC retry config from LDS control-plane updates#2786
LYZJU2019 wants to merge 1 commit into
grpc:masterfrom
LYZJU2019:lyzju2019/xds-transport-channel

Conversation

@LYZJU2019

@LYZJU2019 LYZJU2019 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

  • New unit test retry_config_hot_swaps_from_listener_metadata: publishes a Listener
    and asserts the policy's num_retries hot-swaps 1 -> 3.
  • Full suite: 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-features all pass.

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
LYZJU2019 force-pushed the lyzju2019/xds-transport-channel branch from 99cfc82 to bf14624 Compare July 31, 2026 19:13
@LYZJU2019 LYZJU2019 changed the title feat(tonic-xds): add transport-generic build_transport_channel feat(tonic-xds): drive gRPC retry config from LDS control-plane updates Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant