Skip to content

Commit 326204d

Browse files
chickenkillergabriel-samfira
authored andcommitted
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.
1 parent dadd497 commit 326204d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/templates/userdata/github_linux_userdata.tmpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ if [ ! -d "$RUN_HOME" ];then
7171
downloadAndExtractRunner
7272
sendStatus "installing dependencies"
7373
cd "$RUN_HOME"
74-
sudo ./bin/installdependencies.sh || fail "failed to install dependencies"
74+
attempt=1
75+
while true; do
76+
sudo ./bin/installdependencies.sh && break
77+
if [ $attempt -gt 5 ];then
78+
fail "failed to install dependencies after $attempt attempts"
79+
fi
80+
sendStatus "failed to install dependencies (attempt $attempt): (retrying in 15 seconds)"
81+
attempt=$((attempt+1))
82+
sleep 15
83+
done
7584
else
7685
sendStatus "using cached runner found in $RUN_HOME"
7786
cd "$RUN_HOME"

0 commit comments

Comments
 (0)