From 5d19dbd05e3c1acd3772b2425962c0a6875c4353 Mon Sep 17 00:00:00 2001 From: Davide Principi Date: Fri, 24 Jan 2025 13:06:43 +0100 Subject: [PATCH] fix: extract-image regression Concurrent node/add-module actions fail on flock acquiring the lock file. The lock file is created in a unique path by node/add-module, preventing the execution of multiple modules installation at the same time, which normally happens in cluster/create-cluster and cluster/add-node actions. This commit changes extract-image behavior. The lock file is created under ./ (the working directory) instead of AGENT_INSTALL_DIR/. --- core/imageroot/usr/local/agent/bin/extract-image | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/imageroot/usr/local/agent/bin/extract-image b/core/imageroot/usr/local/agent/bin/extract-image index 0e4ea364d..b382669ef 100755 --- a/core/imageroot/usr/local/agent/bin/extract-image +++ b/core/imageroot/usr/local/agent/bin/extract-image @@ -25,9 +25,9 @@ image=${1:?missing image URL argument} set -e # Prevent concurrent execution of this script with a lock file opened with -# an arbitrary high FD number, like 201. The lock is released when the -# script completes: -exec 201>"${AGENT_STATE_DIR:?}"/.extract-image.lock +# an arbitrary high FD number, like 201. The lock is created in the +# working directory, and is released when the script completes: +exec 201>.extract-image.lock flock --verbose -n 201 lst_file=".imageroot.lst"