]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: avoid unnecessary sleeping in stop_mirror()
authorIlya Dryomov <idryomov@gmail.com>
Tue, 27 Jan 2026 20:56:23 +0000 (21:56 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 28 Jan 2026 14:01:54 +0000 (15:01 +0100)
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 <idryomov@gmail.com>
qa/workunits/rbd/rbd_mirror_helpers.sh

index 316eaaf549ca508d10db692761cc34c5fec012ce..a069853fb71a2aa88f9c915b5c35661b81aea238 100755 (executable)
@@ -442,10 +442,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 1 2 4 8 16 32; do
             sleep $s
             ps auxww | awk -v pid=${pid} '$2 == pid {print; exit 1}' && break
         done