From 90a05a5f8a57928f3d429925468749c482eaf1b6 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 29 Apr 2020 11:05:12 +0200 Subject: [PATCH] Use shared volume for side-car wrapper locks The lock used in the wrapper is under /var/lock in the container which is not shared with the host so the sync script never waits for the wrapper to be done. Moving the lock file to a path on a shared mount in the container seems to solve that particular race. Change-Id: I660b7189a9e1c3197f2cdcc77af62584691dde16 Partial-bug: #1874470 Depends-On: https://review.opendev.org/723522 Signed-off-by: Bogdan Dobrelya --- .../roles/tripleo_systemd_wrapper/templates/service_sync.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 b/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 index 857d55cda..322d42988 100644 --- a/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 +++ b/tripleo_ansible/roles/tripleo_systemd_wrapper/templates/service_sync.j2 @@ -36,7 +36,7 @@ function start_service { jobs_file="{{ tripleo_systemd_wrapper_service_dir }}/{{ tripleo_systemd_wrapper_service_name }}/processes" [ -s "$jobs_file" ] || exit 0 # nothing to do, no need for locking, just exit -exec {lock_fd}>/var/lock/{{ tripleo_systemd_wrapper_service_name }}-processes.lock || exit 1 +exec {lock_fd}>/var/lock/containers/{{ tripleo_systemd_wrapper_service_name }}-processes.lock || exit 1 # In case service_wrapper script already locked the commands, we just wait for a 10 sec. flock -w 10 "$lock_fd" || exit 1