Repository navigation
Wait for the dpkg lock before installing the LaTeX packages - #666
Merged
Merged
Conversation
Preventive: on a freshly launched RunsOn machine unattended-upgrades can still hold the dpkg lock, and apt-get install then fails at once. The race was seen twice in lecture-jax's preview on 2026-11-19, not yet here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the dpkg-lock timeout changes in the CI and publishing workflows.
No open issues 🎉
What changed in this PR
This PR adds a preventive safeguard against dpkg lock contention during LaTeX dependency installation in the CI and publishing workflows.
Changes:
- Configures
apt-get installto wait up to 600 seconds for the dpkg lock. - Adds comments explaining possible contention with unattended upgrades on fresh RunsOn machines; leaves
apt-get updateunchanged.
| File | Description |
|---|---|
.github/workflows/publish.yml |
Adds the lock timeout and explanatory comments to publishing’s LaTeX installation step. |
.github/workflows/ci.yml |
Adds the same timeout and comments to CI’s LaTeX installation step. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The "Install latex dependencies" step in
ci.ymlandpublish.ymlnow waits up to 10 minutes for the dpkg lock (apt-get -o DPkg::Lock::Timeout=600 install) instead of failing at once.cache.ymlinstalls nothing with apt, so it doesn't change.Why: preventive
These workflows run on freshly launched RunsOn machines, where unattended-upgrades can still be running when the job reaches this step. While it runs it holds
/var/lib/dpkg/lock-frontend, andapt-get installfails with "Could not get lock … held by process … (unattended-upgr)". The race has not been seen in this repository yet. It hit lecture-jax's preview twice on 2026-11-19, on the same machine image, and QuantEcon/lecture-jax#375 makes the same change there.apt-get updateis unchanged: it takes a different lock, and it succeeded in both of lecture-jax's failed runs.Testing
This PR's own preview runs the changed step. The race can't be forced, so a green run shows only that the option is accepted and the install still works. With the lock free, apt doesn't wait at all.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL