Skip to content

Retry a stalled apt download on the next mirror, not the same one - #84

Merged
AndreasBur merged 1 commit into
masterfrom
ci-apt-survives-a-slow-mirror
Oct 27, 2026
Merged

AndreasBur merged 1 commit into
masterfrom
ci-apt-survives-a-slow-mirror

Conversation

@theAndreas

Copy link
Copy Markdown
Collaborator

Follow-up to #83, which was merged before this commit reached it.

The first run of #83 showed the retry doing nothing. All four attempts started cmake's 14 MB from azure.archive.ubuntu.com again, and none got through in 240 s; the simulator job was cancelled at its timeout. The runner's /etc/apt/apt-mirrors.txt lists Azure first and archive.ubuntu.com second, but apt only moves down that list on an error, never on a mirror that is merely slow.

What changed

  • From the second attempt on, Azure's line is removed from the mirror list. apt reads the list at the start of every download run (the log shows Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist), so no second apt-get update is needed.
  • timeout now runs under sudo, so its signal reaches apt itself and not only the sudo in front of it.

Tested

The fallback can only be exercised while Azure is actually slow. A green run of this PR shows that the normal path still works and that the cache fills. It does not prove the fallback.

The first run of this pull request showed the retry doing nothing: all
four attempts started cmake's 14 MB from azure.archive.ubuntu.com again
and none got through it in 240 s. The runner's apt-mirrors.txt lists
Azure first and archive.ubuntu.com second, but apt only moves down that
list on an error, never on a mirror that is merely slow.

From the second attempt on, Azure's line is taken out of the list. apt
reads the list at the start of every download run - the log shows it
as "Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist" - so no second
apt-get update is needed for it to apply.

timeout now runs under sudo, so that its signal reaches apt and not
only the sudo in front of it.
@AndreasBur
AndreasBur merged commit 8d79726 into master Oct 27, 2026
11 checks passed
@theAndreas
theAndreas deleted the ci-apt-survives-a-slow-mirror branch October 27, 2026 12:54
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.

3 participants