Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update configure-apt-mock.sh to enable parallelism #11467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update configure-apt-mock.sh to enable parallelism
This adds a few errors that happen when another update/install process is running in parallel. `apt-get update` doesn't handle race conditions well, and `apt-get install` has one as well.

This is pre-cursor to another change that enables parallelism in the packer templates to run the `install-*.sh` scripts parallel, as I mentioned in #2320
  • Loading branch information
fahhem authored Jan 25, 2025
commit 8f0998b67875b59c8ac3c487d18e8b446d0e164e
9 changes: 9 additions & 0 deletions images/ubuntu/scripts/build/configure-apt-mock.sh
Original file line number Diff line number Diff line change
@@ -26,6 +26,15 @@ while [ \$i -le 30 ];do
if grep -q 'Could not get lock' \$err;then
# apt db locked needs retry
retry=true
elif grep -q 'Could not get lock /var/lib/apt/lists/lock' \$err;then
# apt update did not complete (race condition), needs retry
retry=true
elif grep -q 'Problem renaming the file /var/cache/apt/pkgcache.bin.* to /var/cache/apt/pkgcache.bin' \$err;then
# apt-get did not complete (race condition), needs retry
retry=true
elif grep -q 'Problem renaming the file /var/cache/apt/srcpkgcache.bin.* to /var/cache/apt/srcpkgcache.bin' \$err;then
# apt update did not complete (race condition), needs retry
retry=true
elif grep -q 'Could not open file /var/lib/apt/lists' \$err;then
# apt update is not completed, needs retry
retry=true