-
Notifications
You must be signed in to change notification settings - Fork 226
Add apt-retry wrapper for transient apt mirror failures #882
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a bash wrapper script apt-retry that implements retry logic with decorrelated jitter backoff to handle transient apt mirror failures during Docker builds. The wrapper is applied to all apt-get commands across multiple Dockerfile builder stages and the dependencies script.
Key Changes:
- New
apt-retrybash script with decorrelated jitter backoff (up to 5 attempts) - Updated Dockerfile to use apt-retry wrapper for all apt-get operations in 5 builder stages
- Updated dependencies script to use apt-retry for PostgreSQL and package installations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| apt-retry | New bash script implementing retry logic with decorrelated jitter backoff for apt commands |
| Dockerfile | Copies apt-retry to /usr/local/bin/ in 5 builder stages and wraps all apt-get update/install commands |
| dependencies | Wraps apt-get update and install commands with apt-retry to handle transient failures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Add a bash wrapper script that retries apt commands with decorrelated jitter backoff (up to 5 attempts). Apply it to all apt-get update and install commands in the Dockerfile builder stages and dependencies script.
Why
@sisuresh raised today that he'd seen intermittent failures relating to apt installs.
Docker builds intermittently fail due to transient apt mirror issues. Analysis of recent failed runs found the following apt-related failures:
apt-get installlibglib2.0-0t64_2.80.0-6ubuntu3.5_arm64.debapt-get installlibxslt1.1_1.1.39-0exp1ubuntu0.24.04.3_amd64.debapt-get updatePackages.gz - Mirror sync in progress?apt-get updatePackages.gz - Mirror sync in progress?There are two failure patterns:
apt-get updateran and cached version info, but by the time install runs, the mirror has newer versions and old .deb files are gone.Both are transient and benefit from retries. The 404 errors during install require re-running
apt-get updatebefore retrying install, which is why this PR wraps the entireapt-get update && apt-get installsequence together rather than wrapping each command separately.Close #881