-
Notifications
You must be signed in to change notification settings - Fork 353
feat(MeshRetry): support http retryOn for grpc services #15353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Reviewer Checklist🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends the MeshRetry policy to support HTTP retry conditions for gRPC services, aligning with Envoy's capability to retry on conditions under both x-envoy-retry-on and x-envoy-retry-grpc-on headers.
Changes:
- Updated MeshRetry validator to accept HTTP retryOn values in gRPC retryOn configuration
- Refactored XDS configurer to extract common logic for processing HTTP retriables (status codes, methods, retry conditions)
- Removed enum constraint from CRD to allow status code entries in gRPC retryOn field
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/plugins/policies/meshretry/plugin/xds/configurer.go | Refactored retry configuration logic: renamed GrpcRetryOn to GrpcRetriables to handle both gRPC and HTTP retry conditions; extracted HttpRetriables function to consolidate status code and method processing; fixed ensureRetriableStatusCodes to handle empty strings |
| pkg/plugins/policies/meshretry/plugin/v1alpha1/testdata/grpc.listeners.golden.yaml | Updated golden file to reflect new gRPC retry policy supporting HTTP conditions (status codes, request headers) |
| pkg/plugins/policies/meshretry/plugin/v1alpha1/plugin_test.go | Added test cases for mixed gRPC/HTTP retry conditions including ConnectFailure, HttpMethodGet, and status code "429" |
| pkg/plugins/policies/meshretry/k8s/crd/kuma.io_meshretries.yaml | Removed enum constraint on grpc.retryOn to accept string values; updated description and examples to show HTTP retry support |
| pkg/plugins/policies/meshretry/api/v1alpha1/validator_test.go | Extended validation tests to cover all HTTP retry conditions (5xx, GatewayError, methods, status codes) in gRPC context; updated negative test case from "500" to "123" since "500" is now valid |
| pkg/plugins/policies/meshretry/api/v1alpha1/validator.go | Enhanced validateGRPCRetryOn to fallback to HTTP retry validation when value is not a known gRPC enum |
| cause a retry. | ||
| Also, http RetryOn values are supported. |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description could be more precise. Consider rewording to: "RetryOn is a list of conditions which will cause a retry. Supports both gRPC retry conditions (Canceled, DeadlineExceeded, Internal, ResourceExhausted, Unavailable) and HTTP retry conditions (see HTTP retryOn for full list)." This makes it clearer that both types of conditions are supported.
| cause a retry. | |
| Also, http RetryOn values are supported. | |
| cause a retry. Supports both gRPC retry conditions (Canceled, | |
| DeadlineExceeded, Internal, ResourceExhausted, Unavailable) and HTTP | |
| retry conditions (see HTTP retryOn for full list). |
| retryOn: | ||
| description: RetryOn is a list of conditions which will | ||
| cause a retry. | ||
| cause a retry. |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected at the end of this line. This should be removed to maintain consistent formatting in the YAML file.
| cause a retry. | |
| cause a retry. |
Motivation
Envoy
RetryPolicysupports retrying on conditions under bothx-envoy-retry-onandx-envoy-retry-grpc-on. Therefore Kuma should allow all conditions, including httpretryOnconditions, for grpc services.Implementation information
MeshRetrypolicy validator updated to allow input ingrpc.retryOnif it is a valid httpretryOnvalueMeshRetryCRD to accept status code entriesMeshRetryconfigurer updated to support http and grpc conditionsretryOnvalues and retriable status codes and request headers to functionHttpRetriablesGrpcRetryOntoGrpcRetriables, which now returnsretryOnvalues and status codes / headersSupporting documentation
Addresses #12931