feat(meshcircuitbreaker): support retryBudget - #18232
Open
abhyudayareddy wants to merge 1 commit into
Open
abhyudayareddy wants to merge 1 commit into
abhyudayareddy wants to merge 1 commit into
Conversation
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>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Envoy's circuit breaker thresholds support
retry_budget— a dynamic alternative to the flatmax_retriescap. 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).MeshCircuitBreakeronly exposedmaxRetries, so there was no way to configure a retry budget. This came up in #17128 — users had it set viaProxyTemplateon older Kuma and lost it moving ontoMeshCircuitBreaker.Implementation information
retryBudgetunderconnectionLimits, withbudgetPercent(intstr.IntOrString, so"12.5"works) andminRetryConcurrency(uint32).budgetPercentis validated withValidatePercentageOrNiland converted with theenvoyPercenthelper already in the configurer;minRetryConcurrencyis validated like the sibling limits.CircuitBreakers.Thresholds[].RetryBudget. WhenretryBudgetis unset, nothing changes and Envoy keeps applyingmaxRetries, so this is backward compatible.configureCircuitBreakersnow returns an error (for the percentage parse), threaded throughConfigureCluster.zz_generated.deepcopy.go, CRDs,rest.yaml, bundled OpenAPI, kumactl install goldens) with the pinnedcontroller-gen v0.21.0.retryBudget, a negative case (percent > 100,minRetryConcurrency: 0), and a plugin test entry with its golden showingretryBudgetin 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+/formatpass 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.