Skip to content

Wait for the dpkg lock before installing the LaTeX packages - #666

Merged
mmcky merged 1 commit into
mainfrom
ci-apt-lock-wait
Nov 19, 2026
Merged

mmcky merged 1 commit into
mainfrom
ci-apt-lock-wait

Conversation

@mmcky

@mmcky mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What

The "Install latex dependencies" step in ci.yml and publish.yml now waits up to 10 minutes for the dpkg lock (apt-get -o DPkg::Lock::Timeout=600 install) instead of failing at once. cache.yml installs 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, and apt-get install fails 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 update is 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

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
Copilot AI balanced review requested due to automatic review settings November 19, 2026 07:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 install to wait up to 600 seconds for the dpkg lock.
  • Adds comments explaining possible contention with unattended upgrades on fresh RunsOn machines; leaves apt-get update unchanged.
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

@github-actions

Copy link
Copy Markdown

@mmcky
mmcky merged commit bae31ee into main Nov 19, 2026
5 checks passed
@mmcky
mmcky deleted the ci-apt-lock-wait branch November 19, 2026 08:09
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.

2 participants