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

support retry-after header in retry middleware #731

Open
matt-brale-xyz opened this issue Nov 20, 2024 · 2 comments
Open

support retry-after header in retry middleware #731

matt-brale-xyz opened this issue Nov 20, 2024 · 2 comments

Comments

@matt-brale-xyz
Copy link
Contributor

It would be useful to be able to configure the Retry middleware to respect the the Retry-After header when it is returned by the server to minimize resources spent on throttled requests on the client and avoid cascading availability issues due to server load from retries.

Proposed setting logic:

:use_retry_after_header - whether to use the Retry-After header to determine the minimum
delay before the next retry. If the delay from the header exceeds max_delay, no further
retries are attempted. Invalid Retry-After headers are ignored.
(boolean, defaults to false)

Proposed implementation #639

Please let me know if this is a feature that would fit the standard Retry middleware - I'll rebase the PR if it is.

@yordis
Copy link
Member

yordis commented Nov 20, 2024

Please rebase, as long as we default to opt-in, we can merge it

@matt-brale-xyz
Copy link
Contributor Author

Thanks! Rebased the PR - should be good to go. Behavior is opt-in - if the new option isn't supplied, it defaults to false and uses the existing retry logic instead of the header to calculate the delay.

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

No branches or pull requests

2 participants