Skip to content

oauth2: respect user-configured retry_on in retry_policy - #46884

Open
derekargueta wants to merge 1 commit into
envoyproxy:mainfrom
derekargueta:dargueta-oauth2-respect-user-retry-on
Open

oauth2: respect user-configured retry_on in retry_policy#46884
derekargueta wants to merge 1 commit into
envoyproxy:mainfrom
derekargueta:dargueta-oauth2-respect-user-retry-on

Conversation

@derekargueta

Copy link
Copy Markdown
Member

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. 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

`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>
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #46884 was opened by derekargueta.

see: more, trace.

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.

2 participants