Skip to content

feat(meshcircuitbreaker): support retryBudget - #18232

Open
abhyudayareddy wants to merge 1 commit into
kumahq:masterfrom
abhyudayareddy:feat/meshcircuitbreaker-retry-budget-17128
Open

abhyudayareddy wants to merge 1 commit into
kumahq:masterfrom
abhyudayareddy:feat/meshcircuitbreaker-retry-budget-17128

Conversation

@abhyudayareddy

Copy link
Copy Markdown

Motivation

Envoy's circuit breaker thresholds support retry_budget — a dynamic alternative to the flat max_retries cap. Concurrent retries are limited to a percentage of active requests (budget_percent, default 20%), with a floor so retries stay possible under low load (min_retry_concurrency, default 3).

MeshCircuitBreaker only exposed maxRetries, so there was no way to configure a retry budget. This came up in #17128 — users had it set via ProxyTemplate on older Kuma and lost it moving onto MeshCircuitBreaker.

Implementation information

  • New optional retryBudget under connectionLimits, with budgetPercent (intstr.IntOrString, so "12.5" works) and minRetryConcurrency (uint32).
  • budgetPercent is validated with ValidatePercentageOrNil and converted with the envoyPercent helper already in the configurer; minRetryConcurrency is validated like the sibling limits.
  • Passed straight through to the Envoy CircuitBreakers.Thresholds[].RetryBudget. When retryBudget is unset, nothing changes and Envoy keeps applying maxRetries, so this is backward compatible.
  • configureCircuitBreakers now returns an error (for the percentage parse), threaded through ConfigureCluster.
  • Regenerated dependents (zz_generated.deepcopy.go, CRDs, rest.yaml, bundled OpenAPI, kumactl install goldens) with the pinned controller-gen v0.21.0.
  • Tests: a passing validator case with retryBudget, a negative case (percent > 100, minRetryConcurrency: 0), and a plugin test entry with its golden showing retryBudget in the emitted cluster.

make test TEST_PKG_LIST=./pkg/plugins/policies/meshcircuitbreaker/... passes locally. My local toolchain is a minor version behind the repo's pinned Go/golangci-lint, so if the generated-file or lint checks flag anything a maintainer /golden_files + /format pass should sort it.

Supporting documentation

Closes #17128


@kmrgirish — you mentioned back in July you might pick this up; apologies if you had work in progress. Happy to close this in favour of yours if so, otherwise glad to carry it through review.

Envoy's circuit breaker thresholds support 'retry_budget'
(circuit_breakers.thresholds[].retry_budget) as a dynamic alternative to
the static 'max_retries' cap: concurrent retries are limited to a
percentage of active requests, with a minimum floor. MeshCircuitBreaker
only exposed 'maxRetries', so users migrating off ProxyTemplate onto
MeshCircuitBreaker lost this (kumahq#17128).

Add an optional 'retryBudget' to 'connectionLimits' with 'budgetPercent'
(intstr percentage, reusing the existing envoyPercent helper) and
'minRetryConcurrency'. Both are validated like the neighbouring fields
and passed straight through to the Envoy threshold. When unset, Envoy
keeps applying 'maxRetries'.

Closes kumahq#17128

Signed-off-by: Abhyuday <abhyudayareddy@gmail.com>
@abhyudayareddy

Copy link
Copy Markdown
Author

cc @slonka @kongmesh — this has been open a couple weeks with no review yet (feat: support retryBudget for MeshCircuitBreaker). DCO is green. Happy to make any adjustments if you have thoughts. Thanks for taking a look when you have a chance!

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.

feat(MeshCircuitBreaker): add retry_budget support

1 participant