Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tonic-xds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ rcgen = "0.14"
google-cloud-auth = { version = "1.9", default-features = false }

[features]
default = []
testutil = ["dep:tonic-prost"]

# Bundled OpenTelemetry metrics recorder for the gRFC A78 xDS client metrics.
# The recorder lives in the companion `xds-client-opentelemetry` crate so its
# OpenTelemetry version is decoupled from the core crates.
otel = ["dep:opentelemetry", "dep:xds-client-opentelemetry"]

# Load-balancer implementation. The default `tower-lb` stack (tower p2c
# `Balance` + `Buffer`) is used unless `tonic-xds-lb` is enabled, which switches
# to the in-crate `loadbalance/` implementation (`LoadBalancer` + pickers +
# outlier detection).
tonic-xds-lb = []

# TLS crypto backend — pick exactly one.
_tls-any = ["dep:rustls", "dep:rustls-pemfile", "dep:x509-parser"]
tls-ring = ["_tls-any", "tonic/tls-ring", "xds-client/tonic-tls-ring"]
Expand Down
693 changes: 330 additions & 363 deletions tonic-xds/src/client/channel.rs

Large diffs are not rendered by default.

199 changes: 0 additions & 199 deletions tonic-xds/src/client/loadbalance/channel.rs

This file was deleted.

7 changes: 5 additions & 2 deletions tonic-xds/src/client/loadbalance/channel_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
//! manage multiple in-flight state changes and handle cancellation by key.
//!
//! The state types hold the raw service `S` directly. In-flight tracking and
//! load reporting are handled separately by [`LbChannel`] at the pool level.
//! load reporting are handled separately by [`EndpointChannel`] at the pool level.
//!
//! [`KeyedFutures`]: crate::client::loadbalance::keyed_futures::KeyedFutures
//! [`LbChannel`]: crate::client::loadbalance::channel::LbChannel
//! [`EndpointChannel`]: crate::client::endpoint::EndpointChannel

use std::future::Future;
use std::pin::Pin;
Expand Down Expand Up @@ -80,6 +80,7 @@ impl EndpointCounters {
/// can update registry-level counters exactly once per transition.
#[derive(Debug)]
pub(crate) struct OutlierChannelState {
#[allow(dead_code)]
addr: EndpointAddress,
counters: EndpointCounters,
/// Bumped on each ejection; decremented (saturating) on each
Expand All @@ -104,6 +105,7 @@ impl OutlierChannelState {
}

/// Endpoint address this state belongs to.
#[allow(dead_code)]
pub(crate) fn addr(&self) -> &EndpointAddress {
&self.addr
}
Expand Down Expand Up @@ -363,6 +365,7 @@ impl<S> ReadyChannel<S> {
/// Drop the connection and start a fresh connect for the same
/// address. The outlier state is re-attached from `registry`
/// when the new connect resolves.
#[allow(dead_code)]
pub(crate) fn reconnect<C: Connector<Service = S>>(
self,
connector: Arc<C>,
Expand Down
1 change: 1 addition & 0 deletions tonic-xds/src/client/loadbalance/keyed_futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ where
}

/// True if a live (non-cancelled) future is tracked for `key`.
#[allow(dead_code)]
pub(crate) fn contains_key(&self, key: &K) -> bool {
self.cancellations.contains_key(key)
}
Expand Down
2 changes: 1 addition & 1 deletion tonic-xds/src/client/loadbalance/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub(crate) mod channel;
pub(crate) mod channel_state;
pub(crate) mod errors;
pub(crate) mod keyed_futures;
pub(crate) mod loadbalancer;
pub(crate) mod outlier_detection;
pub(crate) mod pickers;
pub(crate) mod service;
1 change: 1 addition & 0 deletions tonic-xds/src/client/loadbalance/outlier_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl OutlierStatsRegistry {
}

/// Number of registered channels.
#[allow(dead_code)]
pub(crate) fn len(&self) -> usize {
self.channels.len()
}
Expand Down
4 changes: 4 additions & 0 deletions tonic-xds/src/client/loadbalance/pickers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
pub(crate) mod p2c;
// Ring-hash (gRFC A42) is implemented but not wired into the first-cut LB,
// which selects P2C.
// TODO: wire ring-hash into the LB.
#[allow(dead_code)]
pub(crate) mod ring_hash;

use indexmap::{IndexMap, IndexSet};
Expand Down
Loading
Loading