Skip to content

internal/envoy: always set NumRetries so numRetries=-1 actually disables retries#7525

Open
SAY-5 wants to merge 1 commit intoprojectcontour:mainfrom
SAY-5:fix/retry-policy-num-retries-zero-5944
Open

internal/envoy: always set NumRetries so numRetries=-1 actually disables retries#7525
SAY-5 wants to merge 1 commit intoprojectcontour:mainfrom
SAY-5:fix/retry-policy-num-retries-zero-5944

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 21, 2026

Summary

HTTPProxy documents numRetries: -1 as "disable retries". The DAG translator in internal/dag/policy.go already maps the API value -1 to the DAG value 0 (with DAG value 1 standing for the default one-retry behaviour).

internal/envoy/v3/route.retryPolicy, however, only forwarded NumRetries to Envoy when the DAG value was > 0. When a user set numRetries: -1, the DAG value 0 silently disappeared from the Envoy RetryPolicy, and Envoy's documented default of 1 kicked in — giving exactly one retry instead of none.

Fix

Always set NumRetries (including 0) so the Envoy config matches what the API promised.

Fixes #5944.

Test

  • go build ./internal/envoy/... green.
  • go test ./internal/envoy/v3/... -count=1 -short passes.

Signed-off-by: SAY-5 SAY-5@users.noreply.github.com

…les retries

HTTPProxy documents `numRetries: -1` as "disable retries". The DAG
translator in internal/dag/policy.go already maps the API value -1 to
the DAG value 0 (with DAG value 1 standing for the default one-retry
behaviour). internal/envoy/v3/route.retryPolicy, however, only
forwarded NumRetries to Envoy when the DAG value was > 0. When a user
set numRetries: -1, the DAG value 0 silently disappeared from the
Envoy RetryPolicy, and Envoy's documented default of 1 kicked in --
giving exactly one retry instead of none (projectcontour#5944).

Always set NumRetries (including 0) so the Envoy config matches what
the API promised.

Fixes projectcontour#5944.

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
@SAY-5 SAY-5 requested a review from a team as a code owner April 21, 2026 20:08
@SAY-5 SAY-5 requested review from sunjayBhatia and tsaarni and removed request for a team April 21, 2026 20:08
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.

setting NumRetries to -1 does not appear to disable retries

1 participant