Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Last retry for a request sleeps unnecessarily #713

Closed
nojnhuh opened this issue Oct 10, 2022 · 1 comment
Closed

Last retry for a request sleeps unnecessarily #713

nojnhuh opened this issue Oct 10, 2022 · 1 comment

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.

@jhendrixMSFT
Copy link
Member

Closing due to staleness. In addition, these modules are no longer supported. See https://github.com/Azure/go-autorest?tab=readme-ov-file#migrating-to-supported-sdks for more info.

This has been fixed in the new Azure SDKs that are based on azcore.

@jhendrixMSFT jhendrixMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants