oauth2: respect user-configured retry_on in retry_policy - #46884
Open
derekargueta wants to merge 1 commit into
Open
oauth2: respect user-configured retry_on in retry_policy#46884derekargueta wants to merge 1 commit into
derekargueta wants to merge 1 commit into
Conversation
`Http::Utility::convertCoreToRouteRetryPolicy()` gives precedence to the caller-supplied `retry_on` over the one set on the `core.v3.RetryPolicy`, so the filter's hardcoded `"5xx,gateway-error,connect-failure,reset"` silently discarded whatever the user configured. - Pass an empty string as the default so the configured `retry_on` is honored, guarded by `envoy.reloadable_features.oauth2_client_retries_respect_user_retry_on` (defaults to true) so the previous behavior can be restored. This mirrors the equivalent fix already made for the HTTP ext_authz client. - Add unit tests covering the configured value reaching the parsed policy, the guard-off path preserving the legacy conditions, and a `retry_policy` that omits `retry_on` now retrying nothing rather than inheriting those four conditions. Four other callers of that helper still pass a non-empty literal and carry the same latent issue; they are left alone here. Risk Level: low Testing: unit tests added Docs Changes: N/A Signed-off-by: Derek Argueta <derek.argueta@airbnb.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.
Http::Utility::convertCoreToRouteRetryPolicy()gives precedence to the caller-suppliedretry_onover the one set on thecore.v3.RetryPolicy, so the filter's hardcoded"5xx,gateway-error,connect-failure,reset"silently discarded whatever the user configured.retry_onis honored, guarded byenvoy.reloadable_features.oauth2_client_retries_respect_user_retry_on(defaults to true) so the previous behavior can be restored. This mirrors the equivalent fix already made for the HTTP ext_authz client.retry_policythat omitsretry_onnow retrying nothing rather than inheriting those four conditions.Four other callers of that helper still pass a non-empty literal and carry the same latent issue; they are left alone here. Let me know if we should fix all of them in this PR or if we should open separate PRs for those.
AI Disclosure: PR generated with AI assistance, has been fully reviewed by myself. We are using the OAuth filter and we realized the retry_policy we set on the OAuth filter was not taking effect.
Risk Level: low
Testing: unit tests added
Docs Changes: N/A