Skip to content

Commit d601d76

Browse files
Milhouszhangclaude
andauthored
ci(workflows): make apt fetches fail fast and retry instead of hanging (#507)
The Ubuntu mirror intermittently accepts a connection and then stops sending data. apt has no read timeout by default, so it blocks forever: run 29012965487 stalled 8.5 min on the 25 MB libwebkit2gtk-4.1-0 fetch and the Desktop backend job was killed by its 20 min timeout-minutes without compiling a single line of Rust. Set a 30s read timeout so a stalled transfer aborts, and 3 retries so apt re-fetches (picking another mirror) instead of failing the job. Applied to both apt-using jobs via a shared env var. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 95dd4dd commit d601d76

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ env:
3131
# tests — which are terminal-/timing-fragile in CI and fail deterministically.
3232
# Force them to skip; they still run locally for anyone who wants them.
3333
PUFFER_SKIP_TMUX_TESTS: "1"
34+
# The Ubuntu mirror intermittently accepts a connection then stops sending.
35+
# apt has no read timeout by default, so it hangs until the job's
36+
# timeout-minutes kills it (seen on the 25 MB libwebkit2gtk-4.1-0 fetch).
37+
# Timeout turns the hang into a failure; Retries then re-fetches it.
38+
APT_RESILIENCE: -o Acquire::http::Timeout=30 -o Acquire::Retries=3
3439

3540
jobs:
3641
rust:
@@ -43,7 +48,9 @@ jobs:
4348
- uses: actions/checkout@v7
4449

4550
- name: Install system dependencies
46-
run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
51+
run: |
52+
sudo apt-get $APT_RESILIENCE update
53+
sudo apt-get $APT_RESILIENCE install -y pkg-config libssl-dev
4754
4855
- uses: dtolnay/rust-toolchain@stable
4956
with:
@@ -227,8 +234,8 @@ jobs:
227234

228235
- name: Install system dependencies
229236
run: |
230-
sudo apt-get update
231-
sudo apt-get install -y pkg-config libssl-dev libwebkit2gtk-4.1-dev \
237+
sudo apt-get $APT_RESILIENCE update
238+
sudo apt-get $APT_RESILIENCE install -y pkg-config libssl-dev libwebkit2gtk-4.1-dev \
232239
libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
233240
234241
- uses: dtolnay/rust-toolchain@stable

0 commit comments

Comments
 (0)