Skip to content

CI: bound every job, apt refresh and download (no more multi-hour hangs) - #375

Merged
GLinnik21 merged 1 commit into
mainfrom
lane/ci-timeouts
Oct 1, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
lane/ci-timeouts

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Diagnosis

CI run 36904995113, job "host unit tests (hostsim)", hung 4 h 36 min (18:12 to cancelled 22:47) on apt-get update. The last log line was Get:5 https://archive.ubuntu.com/ubuntu noble-security InRelease [126 kB], then nothing. Causes:

  1. No job had timeout-minutes, so GitHub's 360-minute default applied.
  2. host-rust's fallback sudo apt-get update had no timeout, and opts (with Acquire::http::Timeout=30) was not passed to it. The stalled fetch was HTTPS, which the http option does not cover. Acquire::https::Timeout is a real separate option: apt's doc/examples/configure-index lists Timeout "30"; in both the http and https blocks of Acquire (apt.conf(5) documents only the http spelling).
  3. simulators.yml ran a plain sudo apt-get update && install with no timeout, retry or cache. Its Linux job shows the same failure mode in the data: one success took 32.5 min, 29 of it in that step.

Fix

  • timeout-minutes on every job (reusable-workflow calls cannot carry it; their limit is on the called workflow's job). Each has a comment with its measured max.
  • New composite .github/actions/apt-install (cached .debs, fetch then install, timeout on every update/fetch, http and https timeouts, bounded last resort). host-rust and the Linux simulator both use it; the cache key is derived from that file's hash plus the package list.
  • Step-level timeout-minutes on brew install and on the webosbrew tooling step; curl gains --connect-timeout 20 --max-time 120 --retry 3 --retry-delay 5. build-package.yml changes are limited to this and its job timeout.
  • ci/test_ci_timeouts.py, run by make check-python: fails on a job without timeout-minutes, an apt-get update not under timeout, or a curl without --max-time. It is red on origin/main (23 findings) and green here; each checker is also proven red on a mutated copy inside the test.

No job names, tests or release behaviour changed.

Measured maxima (last 40 successful runs per workflow; minutes)

workflow / job measured max limit
ci / host lint + type-checks 3.8 10
ci / host unit tests (default features) 10.6 25
ci / host unit tests (hostsim) 12.6 30
ci / host python/shell/C gates 4.6 10
ci / host checks (aggregator) <1 (raw 31.6 predates the split) 10
ci / cross-build 5.0 10
simulators / Linux 32.5 (29 apt stall; typical 4.2) 30
simulators / macOS 22.6 50
simulators / Windows launcher 0.8 10
build-package / build 15.4 nightly, 11.6 release 35
nightly plan / publish / prune 0.3 / 1.4 / 0.2 10 each
release prepare / guard / legal-gate / publish 0.2 / 0.2 / 0.1 / 0.6 10 each
pages build / deploy 0.5 / 0.8 10 each

Per-job durations on this PR's own CI run are recorded in a comment below once it finishes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PUkd69QzFciCfQucbfiyKv

…not hang a run for hours

CI run 36904995113 (host unit tests, hostsim) sat 4 h 36 min on `apt-get update`, last log line
`Get:5 https://archive.ubuntu.com/ubuntu noble-security InRelease`, until it was cancelled. No job
had timeout-minutes (GitHub's default is 360), the fallback update had no `timeout`, and the
`Acquire::http::Timeout` we passed does not cover an HTTPS fetch (and was not passed to update).

- timeout-minutes on every job of ci, simulators, nightly, release, pages and build-package,
  sized at ~2x the max of the last 40 successful runs (measured values in a comment on each).
- New composite .github/actions/apt-install: the cached-.deb, fetch-then-install logic that
  host-rust carried, now with `timeout` on every update/fetch, Acquire::https::Timeout alongside
  http, and a bounded last resort. host-rust and the Linux simulator both use it.
- Step-level bounds on brew install and the webosbrew tooling step; curl gets
  --connect-timeout/--max-time/--retry.
- ci/test_ci_timeouts.py (in check-python) fails on a job without timeout-minutes, an unwrapped
  `apt-get update` or a curl without --max-time; it is red on origin/main (23 findings).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PUkd69QzFciCfQucbfiyKv
@GLinnik21
GLinnik21 merged commit 4f9aa4e into main Oct 1, 2026
23 checks passed
@GLinnik21
GLinnik21 deleted the lane/ci-timeouts branch October 1, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant