]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: stop_mirror() should send a given signal just once
authorIlya Dryomov <idryomov@gmail.com>
Sun, 30 Mar 2025 09:09:33 +0000 (11:09 +0200)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:38 +0000 (21:26 +0530)
Commit e09f04669053 ("qa/workunits/rbd: mirror group functional tests")
moved the kill invocation in stop_mirror() from outside of the wait loop
to inside.  This is wrong because the signal should be sent just once:
rbd-mirror daemon installs a oneshot handler for SIGINT and SIGTERM and
a subsequent signal immediately kills the process.

The same commit also erroneously changed RBD_MIRROR_INSTANCES default
for all rbd_mirror_helpers.sh users instead of just group tests.

This fixes sporadic failures in "TEST: no blocklists".

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
qa/workunits/rbd/rbd_mirror_group.sh
qa/workunits/rbd/rbd_mirror_group_simple.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index a9ca4734521edc45b1c3df631cce382692a01c7e..c1e5a560a6142b194f5facdcdaae322e37950cf1 100755 (executable)
@@ -13,8 +13,8 @@ else
   set -ex
 fi  
 
-MIRROR_POOL_MODE=image
-MIRROR_IMAGE_MODE=snapshot
+RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-1}
+RBD_MIRROR_MODE=snapshot
 
 . $(dirname $0)/rbd_mirror_helpers.sh
 
index 6a55391a1ed2f4422f43873cd8d33560ddd2930f..2bd442474482f248ffbfd284a967c9506444e278 100755 (executable)
@@ -40,7 +40,6 @@
 
 export RBD_MIRROR_NOCLEANUP=1
 export RBD_MIRROR_TEMDIR=/tmp/tmp.rbd_mirror
-export RBD_MIRROR_MODE=snapshot
 
 group0=test-group0
 group1=test-group1
@@ -101,6 +100,9 @@ echo "Scenario number: $scenario_number"
 echo "Test name: $test_name"
 echo "Features: $RBD_IMAGE_FEATURES"
 
+RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-1}
+RBD_MIRROR_MODE=snapshot
+
 # save and clear the cli args (can't call rbd_mirror_helpers with these defined)
 args=("$@")
 set --
index 56bbcf42b5f67e1bb1d32bfdca62053d172107c3..c6555d4cb9b4192e15c129bfa4d262718c8c24c1 100755 (executable)
@@ -84,7 +84,7 @@ else
     exit 1
 fi
 
-RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-1}
+RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-2}
 
 CLUSTER1=cluster1
 CLUSTER2=cluster2
@@ -348,6 +348,7 @@ setup_cluster()
     local cluster=$1
 
     CEPH_ARGS='' ${CEPH_SRC}/mstart.sh ${cluster} -n ${RBD_MIRROR_VARGS}
+
     cd ${CEPH_ROOT}
     rm -f ${TEMPDIR}/${cluster}.conf
     ln -s $(readlink -f run/${cluster}/ceph.conf) \
@@ -616,8 +617,8 @@ stop_mirror()
     pid=$(cat $(daemon_pid_file "${cluster}") 2>/dev/null) || :
     if [ -n "${pid}" ]
     then
+        kill ${sig} ${pid}
         for s in 1 2 4 8 16 32; do
-            kill ${sig} ${pid}
             sleep $s
             ps auxww | awk -v pid=${pid} '$2 == pid {print; exit 1}' && break
         done