fix(ansible): wait on apt's real locks, not process names #72

Merged
jfraeys merged 1 commit from jfraeys/fix/apt-quiet-lock-test into main 2026-10-12 17:29:54 -04:00
Owner

Staging run 491 (21 min): my new apt wait (#71) failed with apt/dpkg still busy after 15 minutes. Matching process names was wrong: unattended-upgr also matches the permanently running unattended-upgrade-shutdown daemon, so the check was always busy.

Now playbooks/files/apt-quiet.py tries the same fcntl locks apt takes (dpkg lock-frontend, dpkg lock, archives lock, lists lock) and waits until they are free, failing with the lock path after 900s. Tested in a Debian 12 container: a permanent process named unattended-upgr no longer blocks (rc 0, instant); an archives lock held 8s is waited out (rc 0, ~10s); a dpkg lock held past the timeout fails cleanly (rc 1, names the lock). Also verified ansible.builtin.script resolves files/apt-quiet.py next to the playbook. ansible-lint, yamllint and syntax-check pass for all four playbooks. 🤖 Generated with Claude Code

Staging run 491 (21 min): my new apt wait (#71) failed with `apt/dpkg still busy after 15 minutes`. Matching process names was wrong: `unattended-upgr` also matches the permanently running unattended-upgrade-shutdown daemon, so the check was always busy. Now playbooks/files/apt-quiet.py tries the same fcntl locks apt takes (dpkg lock-frontend, dpkg lock, archives lock, lists lock) and waits until they are free, failing with the lock path after 900s. Tested in a Debian 12 container: a permanent process named unattended-upgr no longer blocks (rc 0, instant); an archives lock held 8s is waited out (rc 0, ~10s); a dpkg lock held past the timeout fails cleanly (rc 1, names the lock). Also verified ansible.builtin.script resolves files/apt-quiet.py next to the playbook. ansible-lint, yamllint and syntax-check pass for all four playbooks. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ansible): wait on apt's real locks, not process names
All checks were successful
Lint / lint (pull_request) Successful in 2m49s
Secret scan / scan (pull_request) Successful in 12s
cf40b4c0cf
#71's name-based wait always saw the permanent unattended-upgrade-shutdown daemon and timed out after 15 min
(staging run 491). Test the fcntl locks apt takes instead, via playbooks/files/apt-quiet.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!72
No description provided.