Skip to content

ci(gz): bound and retry the Gazebo apt install (24% of runs stalled to the 45-min timeout) - #603

Merged
avrabe merged 1 commit into
mainfrom
ci/gz-install-retry
Oct 23, 2026
Merged

avrabe merged 1 commit into
mainfrom
ci/gz-install-retry

Conversation

@avrabe

@avrabe avrabe commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Measured

Over the last 21 gazebo.yml runs, the Install Gazebo Harmonic step usually takes 1–3 min (11 min at most). 5 of 21 (24%) stalled until the job's 45-minute timeout cancelled them.

Every stall was on the hosted runner's azure.archive.ubuntu.com mirror, and packages were still arriving about every 2 s. Because the connection never goes silent, no per-request apt timeout can catch it.

Under the merge queue, each stall ejects the PR being built. That happened twice on 2026-10-22: #595 at 17:48Z and #571 at 22:27Z. In both cases Kani, CI and the verification gate had passed in the queue.

Change

apt_retry wraps every apt call in this step:

  • Each attempt is capped at 10 min with timeout.
  • Downloaded .debs stay in apt's cache, so a retry resumes instead of starting over.
  • A retry switches off the Azure mirror to archive.ubuntu.com.
  • A real failure still fails: the third attempt's exit status becomes the step's.

Three capped attempts plus the usual ~6 min build fit inside the 45-min job.

Exercised (stubbed sudo / apt-get, the function extracted from this workflow)

case rc attempts mirror switches
hang, then ok 0 2 1
always fails 1 3 3
ok 0 1 0

actionlint is clean. The diff has no Kani-scope hits.

Not changed: soak.yml has two copies of the same install. It is not a required gate, so a stall there ejects nothing; it is a follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG

… to the 45-min timeout and ejected queued PRs

Measured over the last 21 gazebo.yml runs: "Install Gazebo Harmonic"
takes 1-3 min normally (max 11), but 5 of 21 (24%) stalled on the hosted
runner's azure.archive.ubuntu.com mirror until the job's 45-min timeout
cancelled them. They were still receiving one package every ~2 s, so no
per-request apt timeout could fire. Under the merge queue each stall
EJECTS the PR being built: #595 (17:48Z) and #571 (22:27Z) on 2026-10-22.

apt_retry: each attempt capped at 10 min with `timeout`; downloaded .debs
stay in apt's cache so a retry resumes; a retry moves off the azure
mirror to archive.ubuntu.com. A real failure still fails (the third
attempt's status is the step's). Exercised with stubbed sudo/apt-get:
hang-then-ok rc=0 after 2 attempts + 1 mirror switch; always-fail rc=1
after 3; ok rc=0 after 1. Three capped attempts plus the usual ~6 min
build stay inside the 45-min job.

soak.yml carries two copies of the same install; not changed here (not a
required gate, so it ejects nothing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
@avrabe
avrabe enabled auto-merge October 22, 2026 22:48
@avrabe
avrabe added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 98d9b95 Oct 23, 2026
13 checks passed
@avrabe
avrabe deleted the ci/gz-install-retry branch October 23, 2026 00:53
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