Skip to content

xds-client: add value-based transport config to server key - #2835

Open
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:xds-federation/server-config
Open

xds-client: add value-based transport config to server key#2835
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:xds-federation/server-config

Conversation

@W4lspirit

@W4lspirit W4lspirit commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Make ServerConfig value-comparable and hashable using its URI and optional transport configuration.
  • Add TransportConfig, an opaque transport-owned value that preserves concrete-type equality and hashing behind an Arc and supports typed downcasting.
  • Keep server configurations in Arcs while the ADS worker reconnects, so the same immutable configuration is passed to the transport builder.
  • Add tests covering value equality, distinct URIs and transport types, safe downcasting/debug output, and a map-backed configuration with order-independent hashing.

Why

xDS federation will need to de-duplicate management-server channels by server configuration instead of URI alone. Transport settings such as the selected channel credentials must participate in that key so two definitions with the same URI but different connection settings do not accidentally share a channel.

Requiring transport values to implement Eq + Hash makes this a compile-time contract. It avoids a separate manually maintained identity string that could diverge from the value consumed by the transport.

Scope

This is the first server-key building block, not complete gRFC A47 support. The current key covers URI and transport configuration only. Known server features, including the legacy ignore_resource_deletion behavior from gRFC A53/A88, must participate when those features are modeled.

TransportConfig is intentionally transport-only. It is passed through ServerConfig to TransportBuilder; it is not a general extension mechanism and is not exposed to resource decoders. Wiring concrete per-server credentials into the tonic transport is also left for follow-up work.

I'll eventually update the transport builder trait to only use the server identifier(uri+transportConfig) instead of the ServerConfig.

Validation

  • cargo test -p xds-client client::config::tests
  • cargo clippy -p xds-client --all-targets -- -D warnings
  • cargo doc -p xds-client --no-deps
  • cargo fmt --all -- --check

Part of #2795.

@W4lspirit W4lspirit changed the title [codex] xds-client: add value-based transport config to server key xds-client: add value-based transport config to server key Aug 25, 2026
@W4lspirit
W4lspirit marked this pull request as ready for review August 25, 2026 11:53
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