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

Retry download of a dependency with back off #524

Closed
stipx opened this issue Nov 15, 2017 · 4 comments
Closed

Retry download of a dependency with back off #524

stipx opened this issue Nov 15, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@stipx
Copy link
Contributor

stipx commented Nov 15, 2017

Hi,

as far as I can see there is a retry mechanism in on downloads of dependencies. The thing is that there seems to be no back off strategy implemented. The retry is just done right away:

if (failures += 1) > FAILURE_LIMIT
InternetAvailability.instance.available false, "Request failed: #{e.message}"
raise e
else
@logger.warn { "Request failure #{failures}, retrying. Failure: #{e.message}" }
retry
end

It might make sense to have some kind of exponential back off there to give the download endpoint some time to recover if there are some serverside problems.

Please share your thoughts on this.

Best
stipx

@nebhale nebhale self-assigned this Nov 16, 2017
@nebhale nebhale added this to the v4.7 milestone Nov 16, 2017
@nebhale
Copy link
Contributor

nebhale commented Nov 16, 2017

Seems reasonable.

@nebhale
Copy link
Contributor

nebhale commented Nov 28, 2017

Any thoughts about the backoff intervals you'd see as helpful in practice?

@nebhale nebhale modified the milestones: v4.7, v4.8 Nov 30, 2017
@stipx
Copy link
Contributor Author

stipx commented Dec 5, 2017

I always find the exponential back off pretty useful. It reduces backpressure but also picks up small hiccups pretty fast.

The function to get the wait interval is:
sleep = min(cap, base + 2 ** attempt)

I usually use a pretty small 'base' like 5 seconds and a 'cap' of around 60 to 90 seconds.

@nebhale
Copy link
Contributor

nebhale commented Dec 5, 2017

Right, I was wondering if you were thinking of a cap in the single second range or larger. Let me poll around some others and see what the consensus is and I’ll put something in.

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

No branches or pull requests

2 participants