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

Last retry for a request sleeps unnecessarily #713

Open
nojnhuh opened this issue Oct 10, 2022 · 0 comments
Open

Last retry for a request sleeps unnecessarily #713

nojnhuh opened this issue Oct 10, 2022 · 0 comments

Comments

@nojnhuh
Copy link
Member

nojnhuh commented Oct 10, 2022

Once a request is found to have failed and to be retried, the applicable HTTP 429 Retry-After or exponential backoff logic kicks in and sleeps for the appropriate amount of time before trying the request again. This sleep occurs even after the last attempt which only delays callers from receiving the ultimate response. Any sleeping should only occur when there is at least one retry attempt remaining.

ref:

func doRetryForStatusCodesImpl(s Sender, r *http.Request, count429 bool, attempts int, backoff, cap time.Duration, codes ...int) (resp *http.Response, err error) {

Combined with #712, this causes any request consistently failing with a retry-able status code to take 90s+ with the default 30s RetryDuration on clients (30s for the first request + 60s for the second request). Made only once and without sleeping after, I see the same request take ~3s.

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

1 participant