Commit 54c89e1
committed
azure-pipelines: wait for the dpkg lock when installing Linux deps
The 1ES Ubuntu agents come up with the `unattended-upgrades` service
already running, which holds `/var/lib/dpkg/lock-frontend` for the
first few minutes after boot. The Linux build's 'Install build
dependencies' and the Linux validate job's 'Install Git' steps both
ran `sudo apt-get update` immediately and intermittently failed
with
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process <pid> (unattended-upgr)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
(see e.g. pipeline run #96 of debug-azp), aborting the entire job
on what is genuinely just a timing race.
Pass `-o DPkg::Lock::Timeout=600` to the affected `apt-get update`
and `apt-get install` invocations on both the build and validate
jobs. apt 2.1+ (Ubuntu 22.04 ships 2.4) honours this option by
internally polling for the lock rather than failing immediately,
which both turns the race into a backoff and lets us keep the
existing one-line apt invocations rather than wrapping them in an
ad-hoc retry loop. 600 seconds is enough headroom for the longest
boot-time unattended-upgrades run we have observed in CI without
giving up so late that a genuinely stuck lock would still block the
agent forever.
A short comment on the build-job step captures the rationale; the
validate-job comment cross-references it instead of duplicating the
explanation.
Assisted-by: Claude Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent bb77905 commit 54c89e1
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
922 | | - | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
923 | 931 | | |
924 | 932 | | |
925 | 933 | | |
| |||
1151 | 1159 | | |
1152 | 1160 | | |
1153 | 1161 | | |
1154 | | - | |
1155 | | - | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1156 | 1167 | | |
1157 | 1168 | | |
1158 | 1169 | | |
| |||
0 commit comments