Skip to content

Commit c95b6bb

Browse files
authored
fix: Do not set backendRequestTimeout when Retries are set (envoyproxy#6421)
* fix: Do not set backendRequestTimeout when Retries are set Signed-off-by: sudipto baral <sudiptobaral.me@gmail.com> * fix: update comment Signed-off-by: sudipto baral <sudiptobaral.me@gmail.com> --------- Signed-off-by: sudipto baral <sudiptobaral.me@gmail.com>
1 parent f86ead4 commit c95b6bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/gatewayapi/route.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ func processRouteTimeout(irRoute *ir.HTTPRoute, rule gwapiv1.HTTPRouteRule) {
325325
irRoute.Timeout = ptr.To(metav1.Duration{Duration: d})
326326
}
327327

328-
// Also set the IR Route Timeout to the backend request timeout
329-
// until we introduce retries, then set it to per try timeout
330-
if rule.Timeouts.BackendRequest != nil {
328+
// Only set the IR Route Timeout to the backend request timeout
329+
// when retries are not configured. When retries are configured,
330+
// the backend request timeout should set for per-retry timeout.
331+
if rule.Timeouts.BackendRequest != nil && rule.Retry == nil {
331332
d, err := time.ParseDuration(string(*rule.Timeouts.BackendRequest))
332333
if err != nil {
333334
d, _ = time.ParseDuration(HTTPRequestTimeout)

internal/gatewayapi/testdata/httproute-retry.out.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ xdsIR:
323323
retryOn:
324324
httpStatusCodes:
325325
- 500
326-
timeout: 3s
327326
traffic:
328327
retry:
329328
numAttemptsPerPriority: 1

0 commit comments

Comments
 (0)