Skip to content

CI: stop apt before saving the package cache after a timeout - #10

Merged
thePunderWoman merged 1 commit into
mainfrom
ci-cache-stop-apt-before-save
Nov 19, 2026
Merged

thePunderWoman merged 1 commit into
mainfrom
ci-cache-stop-apt-before-save

Conversation

@thePunderWoman

Copy link
Copy Markdown
Member

Follow-up to #9. The first run on main after #9 landed (44402841035) started cold and timed out, as expected on a slow mirror. Then the save it depends on failed:

tar: ../../../apt-cache/archives/partial/mesa-libgallium_25.2.8-0ubuntu0.24.04.5_amd64.deb: file changed as we read it
Warning: Failed to save: "/usr/bin/tar" failed with error: ... exit code 1

When a step times out, the runner kills it, but apt's download processes keep running and writing into the cache. The save on #9's timed-out run only worked by luck.

Change

Before saving, the step (renamed Prepare the package cache for saving) now stops apt-get and its download methods (/usr/lib/apt/methods/*). It sends SIGTERM, waits up to 10 s, then SIGKILL. The patterns are anchored, so the step can't match its own sudo. Half-downloaded files stay in partial/, and apt resumes them on the next run.

The same commit is on PunderWorks/DroidPowerSense#19 and PunderWorks/VocalizerCAN#7.

Testing

On this PR, the cache is restored from main. main has no usable cache yet because its first save failed, so this run starts cold too. If it times out, the save should now succeed, and that's the fix being tested.

🤖 Generated with Claude Code

When Install KiCad 10 times out, the runner kills the step but apt's download
processes keep running. Saving the cache then failed on DroidCANBridge main
(run 44402841035): "tar: .../archives/partial/mesa-libgallium_...deb: file
changed as we read it", and nothing was kept. Stop apt-get and its download
methods before saving; half-downloaded files stay in partial/ for apt to
resume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thePunderWoman
thePunderWoman merged commit 32feb0b into main Nov 19, 2026
4 of 6 checks passed
@thePunderWoman
thePunderWoman deleted the ci-cache-stop-apt-before-save branch November 19, 2026 00:20
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