internal/envoy: always set NumRetries so numRetries=-1 actually disables retries#7525
Open
SAY-5 wants to merge 1 commit intoprojectcontour:mainfrom
Open
internal/envoy: always set NumRetries so numRetries=-1 actually disables retries#7525SAY-5 wants to merge 1 commit intoprojectcontour:mainfrom
SAY-5 wants to merge 1 commit intoprojectcontour:mainfrom
Conversation
…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>
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.
Summary
HTTPProxy documents
numRetries: -1as "disable retries". The DAG translator ininternal/dag/policy.goalready maps the API value-1to the DAG value0(with DAG value1standing for the default one-retry behaviour).internal/envoy/v3/route.retryPolicy, however, only forwardedNumRetriesto Envoy when the DAG value was> 0. When a user setnumRetries: -1, the DAG value0silently disappeared from the EnvoyRetryPolicy, and Envoy's documented default of1kicked in — giving exactly one retry instead of none.Fix
Always set
NumRetries(including0) so the Envoy config matches what the API promised.Fixes #5944.
Test
go build ./internal/envoy/...green.go test ./internal/envoy/v3/... -count=1 -shortpasses.Signed-off-by: SAY-5 SAY-5@users.noreply.github.com