From 930dc6adfc828e55a1e2c96f2f5612b4e38116b1 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Wed, 22 Feb 2023 20:13:45 +0530 Subject: [PATCH] github/actions: Introduce a timeout to avoid apt races There are chances that apt-get operations are run on the same VM by different runners both competing to get apt locks. Introduce timeout of 3 seconds, in case the lock is already taken by another instance of a runner. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka (cherry picked from commit ddcd79dede4265d891247004432f9c4e845a5a4a) --- .github/actions/setup-libcgroup/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-libcgroup/action.yml b/.github/actions/setup-libcgroup/action.yml index 29d3f85e..83d63dbd 100644 --- a/.github/actions/setup-libcgroup/action.yml +++ b/.github/actions/setup-libcgroup/action.yml @@ -11,9 +11,13 @@ description: "Install dependencies, git clone, bootstrap, configure, and make li runs: using: "composite" steps: - - run: sudo apt-get update + - run: | + while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do sleep 3; done + sudo apt-get update shell: bash - - run: sudo apt-get install libpam-dev lcov python3-pip python3-dev cmake bison flex byacc g++ autoconf automake libtool libsystemd-dev -y + - run: | + while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do sleep 3; done + sudo apt-get install libpam-dev lcov python3-pip python3-dev cmake bison flex byacc g++ autoconf automake libtool libsystemd-dev -y shell: bash - run: sudo pip install cython shell: bash -- 2.47.2