From: Ilya Dryomov Date: Tue, 27 Jan 2026 20:56:23 +0000 (+0100) Subject: qa/workunits/rbd: avoid unnecessary sleeping in stop_mirror() X-Git-Tag: testing/wip-jcollin-testing-20260217.025616-squid~7^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=066b547ba3e4fbae7ea27ec33ed66cd1ea2fb92c;p=ceph-ci.git qa/workunits/rbd: avoid unnecessary sleeping in stop_mirror() There is no need to wait for anything if -KILL is passed for sig because the process would disappear immediately. In teuthology runs where multiple rbd-mirror daemons are deployed (and therefore need to be stopped when stop_mirrors() is called by the test), it causes gratuitous delays of 4+ seconds. Signed-off-by: Ilya Dryomov (cherry picked from commit f18fe5d15f72e34ab74b8ae187a47b52883fc780) --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 7aa9639f12b..9b82d088bc2 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -451,10 +451,9 @@ stop_mirror() local pid pid=$(cat $(daemon_pid_file "${cluster}") 2>/dev/null) || : - if [ -n "${pid}" ] - then + if [ -n "${pid}" ]; then kill ${sig} ${pid} - for s in 1 2 4 8 16 32; do + for s in 0 1 2 4 8 16 32; do sleep $s ps auxww | awk -v pid=${pid} '$2 == pid {print; exit 1}' && break done