From 326204d1a684fbd1143a5f35178b56bd6c9c7170 Mon Sep 17 00:00:00 2001 From: Lionel ORRY Date: Tue, 4 Nov 2025 10:18:30 +0100 Subject: [PATCH] Fix dpkg lock file conflicts during runner install Added a loop over installdependencies.sh call so that if a parallel process is using dpkg, we can wait and try again. The timeout between attempts is set at 15sec, and the max number of attempts is 5. --- .../templates/userdata/github_linux_userdata.tmpl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/templates/userdata/github_linux_userdata.tmpl b/internal/templates/userdata/github_linux_userdata.tmpl index cd672d7e..213153a5 100644 --- a/internal/templates/userdata/github_linux_userdata.tmpl +++ b/internal/templates/userdata/github_linux_userdata.tmpl @@ -71,7 +71,16 @@ if [ ! -d "$RUN_HOME" ];then downloadAndExtractRunner sendStatus "installing dependencies" cd "$RUN_HOME" - sudo ./bin/installdependencies.sh || fail "failed to install dependencies" + attempt=1 + while true; do + sudo ./bin/installdependencies.sh && break + if [ $attempt -gt 5 ];then + fail "failed to install dependencies after $attempt attempts" + fi + sendStatus "failed to install dependencies (attempt $attempt): (retrying in 15 seconds)" + attempt=$((attempt+1)) + sleep 15 + done else sendStatus "using cached runner found in $RUN_HOME" cd "$RUN_HOME"