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

SchemeWithRetries.Fetch improved timeout handling #2786

Open
HouseK opened this issue Oct 20, 2023 · 0 comments
Open

SchemeWithRetries.Fetch improved timeout handling #2786

HouseK opened this issue Oct 20, 2023 · 0 comments
Labels
Feature Request Feature Request

Comments

@HouseK
Copy link

HouseK commented Oct 20, 2023

Is your feature request related to a problem? Please describe.
Exponential backoff takes longer to retry than expected.

Describe the solution you'd like

func (s *SchemeWithRetries) Fetch(ctx context.Context, u *url.URL) (io.ReaderAt, error) {

Don't sleep for the full NextBackOff duration, but only for the remainder after subtracting the time Fetch took.

Pass a context to Fetch with a timeout equal to the nextbackoff duration.

Describe alternatives you've considered
Doing nothing. This still works but is IMO just a bit less accurate since long timeouts actually slow down the retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant