Skip to content

tonic-xds: Add A32 circuit breaking limiter#2711

Open
mingley wants to merge 3 commits into
grpc:masterfrom
mingley:mingley/a32-circuit-breaking-core
Open

tonic-xds: Add A32 circuit breaking limiter#2711
mingley wants to merge 3 commits into
grpc:masterfrom
mingley:mingley/a32-circuit-breaking-core

Conversation

@mingley

@mingley mingley commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Motivation

gRFC A32 circuit breaking is parsed by tonic-xds, but requests are not yet limited. This splits out the reusable enforcement primitive first so the request-lifetime behavior can be reviewed independently before production CDS/channel wiring lands.

This is part of #2444, which tracks adding xDS support to Tonic and gRPC.

Solution

  • Add a client::circuit_breaking Tower layer that enforces max_requests with process-global counters keyed by cluster and EDS service name.
  • Hold permits for the full response-body lifetime, including streaming responses and dropped response futures.
  • Return gRPC statuses for circuit-breaking and missing routing decisions, keep local drops out of retry policy, and track drop counts for future LRS export.
  • Add unit coverage for rejection, permit release, cancellation, retry behavior, EDS-service-name keying, and counter cleanup.

Testing Done

  • cargo fmt --all --check
  • cargo check -p tonic-xds --all-features
  • cargo test -p tonic-xds circuit_breaking --lib

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 30, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mingley / name: Michael Ingley (4609832)

@mingley mingley force-pushed the mingley/a32-circuit-breaking-core branch from b8bbda3 to 4609832 Compare June 30, 2026 17:03
@mingley mingley force-pushed the mingley/a32-circuit-breaking-core branch from 4609832 to 36b0376 Compare June 30, 2026 17:20
@YutaoMa

YutaoMa commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

For PRs to tonic-xds, mention that in the PR title for better searchability.

Comment thread tonic-xds/src/client/circuit_breaking.rs Outdated
Comment thread tonic-xds/src/client/circuit_breaking.rs Outdated
@mingley mingley changed the title Add A32 circuit breaking limiter tonic-xds: Add A32 circuit breaking limiter Jun 30, 2026
Comment thread tonic-xds/src/client/circuit_breaking.rs Outdated
Comment thread tonic-xds/src/client/circuit_breaking.rs Outdated
@mingley

mingley commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

For PRs to tonic-xds, mention that in the PR title for better searchability.

updated PR description to track #2444 and also updated title to include tonic-xds

@mingley mingley requested a review from YutaoMa June 30, 2026 21:47
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.

2 participants