-
Notifications
You must be signed in to change notification settings - Fork 21
fix: Handle intermittent network errors #54
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
base: master
Are you sure you want to change the base?
fix: Handle intermittent network errors #54
Conversation
Intermittent network errors may happen when a module's source code is downloaded. That happened to me recently (an unexpected 502 from GitHub) which resulted in a missing module in my Docker image (that was partially my fault, as the build process should stop in case of any error). This PR implements automatic retries for common transient network hiccups.
Any helping in getting this in would be appreciated @oxpa @thresheek. |
Thanks for the patch. I've looked up when those options appeared in wget:
Now, looking at the oldest currently supported distros by
That means if we're to merge this change, we're going to abandon at least two operating systems, one of which is arguably very widely used. I'm inclined to NACK for this reason. @oxpa your thoughts? |
Such network issues never happened to me. So I probably tend to downplay the importance of the patch.
And then
This way it works anywhere and can be reused for other places where retries make sense. |
Thanks for the feedback guys, these are very valid points. I didn't check it myself, but kind of hoped for better support across supported operating systems. Adding these new params as-is is definitely not a viable solution. The retry loop approach seems much more universal. I'm going to rewrite the PR and include this suggestion. |
@oxpa @thresheek I've just updated the PR as per your suggestion. The updated logic has been tested against one of my NGINX container images and it worked as expected:
|
Proposed changes
Intermittent network errors may happen when a module's source code is downloaded. That happened to me recently (an unexpected 502 from GitHub) which resulted in a missing module in my Docker image (that was partially my fault, as the build process should stop in case of any error).
This PR implements automatic retries for common transient network hiccups.
Here's how that's going to work in practice:
As per the documentation,
wget
uses linear backoff between retry attempts by default:Checklist
Before creating a PR, run through this checklist and mark each as complete:
README.md
and/orCHANGELOG.md
).