Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: oauth2 filter supports retries to improve communication stability with OAuth2 severs #33572

Open
zhaohuabing opened this issue Apr 16, 2024 · 7 comments
Labels
area/oauth enhancement Feature requests. Not bugs or questions.

Comments

@zhaohuabing
Copy link
Member

zhaohuabing commented Apr 16, 2024

Title: enhancement: oauth2 filter supports retries to improve communication stability with OAuth2 severs

Description:
EG user reported: we are frequently seeing routes hosted by the Gateway fail with a 401, returning an error OAuth flow failed.. Looking at the logs it seems this occurs where Envoy decides to re-use an existing long-lived connection to our OIDC issuer. Failures seem to correlate with Envoy picking connections that are in the order of 50 minutes old.

Allowing retries after failing to send requests to OAuth2 server can solve this problem.

[optional Relevant Links:]
EG issue: envoyproxy/gateway#3178

@zhaohuabing zhaohuabing added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Apr 16, 2024
@zhaohuabing
Copy link
Member Author

Please assign this issue to me if it makes sense.

@adisuissa
Copy link
Contributor

cc @derekargueta @mattklein123 as codeowners

@derekargueta
Copy link
Member

So the issue is that the connection may have been closed by the identity provider but the Oauth filter still tries the old connection? If that's the case a retry mechanism sounds pretty reasonable to me.

Wonder if there's a deeper issue here of the closed connection being recognized by the oauth filter (unless it's a race condition as mentioned in the EG ticket)

@zhaohuabing
Copy link
Member Author

zhaohuabing commented Apr 18, 2024

@derekargueta I found some similar issues. They didn't happen in the Oauth filter but I think they're still valid. This issue is caused by the HTTP Client using a closed connection from the pool.
#14981
istio/istio#47037

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 18, 2024
@derekargueta
Copy link
Member

@zhaohuabing are you still planning on providing a PR for this issue?

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label May 18, 2024
@zhaohuabing
Copy link
Member Author

@derekargueta yes, please assign it to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oauth enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

3 participants