Skip to content

Commit 0357b13

Browse files
committed
Follow the gRPC status codes spec naming
1 parent 54e5c50 commit 0357b13

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

geps/gep-3440/index.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ trigger retries if specified, while errors like `403` and `404` are not retryabl
100100
### HAProxy
101101
1. **Retry Conditions**: HAProxy can retry requests based on various network conditions
102102
(e.g., connection failures, timeouts) and some HTTP error codes. While HAProxy does support gRPC via HTTP/2, it does not
103-
have built-in support for handling specific gRPC error codes (like `Cancelled`, `Deadline Exceeded`).
103+
have built-in support for handling specific gRPC status codes (like `Cancelled`, `Deadline Exceeded`).
104104
It relies on HTTP-level conditions for retries, so its gRPC support is less granular than the GEP requires.
105105
2. **Retry Limits**: HAProxy allows you to set a maximum number of retries for a request using the `retries` directive.
106106
It also supports setting a timeout for the entire retry process using the `timeout connect` and `timeout server` directives.
@@ -110,7 +110,7 @@ It also supports setting a timeout for the entire retry process using the `timeo
110110
certain HTTP status codes like 500, 502, 503, and 504), but it does not natively interpret specific gRPC status codes
111111
like `UNAVAILABLE` or `DEADLINE_EXCEEDED`. This means that, while Traefik can retry requests on common HTTP errors
112112
that might represent temporary issues, it lacks the ability to directly handle and retry based on
113-
gRPC-specific error codes, limiting its alignment with the GEP’s requirement for granular gRPC error handling.
113+
gRPC-specific error codes, limiting its alignment with the GEP’s requirement for granular gRPC status codes handling.
114114
2. **Retry Limits**: Traefik provides configurable retry attempts and can set a maximum number of retries. However,
115115
Traefik does not offer per-try timeout controls specific to each retry attempt. Instead, it typically relies on a
116116
global request timeout, limiting the flexibility needed for more precise gRPC retry management (like Envoy’s `per_try_timeout`).
@@ -140,28 +140,28 @@ type GRPCRouteRule struct {
140140

141141
// GRPCRouteRetry defines retry configuration for a GRPCRoute.
142142
//
143-
// Implementations SHOULD retry on common transient gRPC errors
143+
// Implementations SHOULD retry on common transient gRPC status codes
144144
// if a retry configuration is specified.
145145
//
146146
type GRPCRouteRetry struct {
147-
// Reasons defines the gRPC error conditions for which a backend request
147+
// Reasons defines the gRPC status codes for which a backend request
148148
// should be retried.
149149
//
150-
// Supported gRPC error conditions:
151-
// * "cancelled"
152-
// * "deadline-exceeded"
153-
// * "internal"
154-
// * "resource-exhausted"
155-
// * "unavailable"
150+
// Supported gRPC status codes:
151+
// * "CANCELLED"
152+
// * "DEADLINE_EXCEEDED"
153+
// * "INTERNAL"
154+
// * "RESOURCE_EXHAUSTED"
155+
// * "UNAVAILABLE"
156156
//
157-
// Implementations MUST support retrying requests for these conditions
157+
// Implementations MUST support retrying requests for these status codes
158158
// when specified.
159159
//
160160
// Support: Extended
161161
//
162162
// +optional
163163
// <gateway:experimental>
164-
Reasons []GRPCRouteRetryCondition `json:"reasons,omitempty"`
164+
Reasons []GRPCRouteRetryStatusCode `json:"reasons,omitempty"`
165165

166166
// Attempts specifies the maximum number of times an individual request
167167
// from the gateway to a backend should be retried.
@@ -200,21 +200,21 @@ type GRPCRouteRetry struct {
200200
Backoff *Duration `json:"backoff,omitempty"`
201201
}
202202

203-
// GRPCRouteRetryCondition defines a gRPC error condition for which a backend
203+
// GRPCRouteRetryStatusCode defines a gRPC status code for which a backend
204204
// request should be retried.
205205
//
206-
// The following conditions are considered retryable:
206+
// The following status codes are considered retryable:
207207
//
208-
// * "cancelled"
209-
// * "deadline-exceeded"
210-
// * "internal"
211-
// * "resource-exhausted"
212-
// * "unavailable"
208+
// * "CANCELLED"
209+
// * "DEADLINE_EXCEEDED"
210+
// * "INTERNAL"
211+
// * "RESOURCE_EXHAUSTED"
212+
// * "UNAVAILABLE"
213213
//
214-
// Implementations MAY support additional gRPC error codes if applicable.
214+
// Implementations MAY support additional gRPC status codes if applicable.
215215
//
216-
// +kubebuilder:validation:Enum=cancelled;deadline-exceeded;internal;resource-exhausted;unavailable
217-
type GRPCRouteRetryCondition string
216+
// +kubebuilder:validation:Enum=CANCELLED;DEADLINE_EXCEEDED;INTERNAL;RESOURCE_EXHAUSTED;UNAVAILABLE
217+
type GRPCRouteRetryStatusCode string
218218

219219
// Duration is a string value representing a duration in time.
220220
// Format follows GEP-2257, which is a subset of Golang's time.ParseDuration syntax.
@@ -259,7 +259,7 @@ To ensure correct gRPC retry functionality, the following tests must be implemen
259259
- **Test**: Verify retries respect the BackendRequestTimeout. Requests should fail if the timeout is reached, even with retries.
260260
- **Expected**: Retries occur within the configured timeout, and fail if exceeded.
261261
2. `SupportGRPCRouteRetry`
262-
- **Test**: Ensure retries are triggered for retryable gRPC errors (cancelled, deadline-exceeded, internal, resource-exhausted, unavailable).
262+
- **Test**: Ensure retries are triggered for retryable gRPC status codes (cancelled, deadline-exceeded, internal, resource-exhausted, unavailable).
263263
- **Expected**: Retries for retryable errors; no retries for non-retryable errors.
264264
3. `SupportGRPCRouteRetryBackoff`
265265
- **Test**: Confirm retries use the configured backoff strategy.

0 commit comments

Comments
 (0)