Skip to content

tonic-xds: Add A32 circuit breaking limiter#2711

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

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

Conversation

@mingley

@mingley mingley commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

gRFC A32 circuit-breaking configuration is parsed by tonic-xds, but request enforcement is not yet in the channel path. This PR adds the reusable limiter primitive first so its request-lifetime and state-management behavior can be reviewed independently before production CDS/channel wiring lands. It is part of #2444.

  • Enforce max_requests with process-global in-flight counters keyed by cluster and EDS service name, while retaining per-channel drop accounting for future LRS integration (36b03763, 4a20f392, c6b89daa).
  • Admit calls only after the wrapped per-cluster service is ready, so queued work does not consume capacity, and mark local UNAVAILABLE drops so gRPC retry policy does not retry them (c6b89daa).
  • Hold permits through the full response-body lifetime and release them on trailers, body errors, completion, response-future cancellation, or response drop (36b03763, c6b89daa).
  • Apply live limit changes without resetting in-flight counts and clean up counters across EDS service-name changes, config removal/recreation, and channel teardown (c4559d3e, 4a20f392, c6b89daa).
  • Cover the default 1024-request boundary, process-wide sharing, per-channel drop attribution, retry behavior, readiness, cancellation, and counter cleanup (c6b89daa).

Testing Done

  • cargo fmt --all --check
  • cargo clippy -p tonic-xds --lib --all-features -- -D warnings - passed
  • cargo test -p tonic-xds circuit_breaking --lib - 23 passed, 0 failed
  • cargo test -p tonic-xds --all-features - 389 unit tests and 4 doc tests passed
  • gh pr checks 2711 --repo grpc/grpc-rust - all non-skipped PR checks passed

@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