]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/stop.sh: check if ceph-mds daemon(s) exist beforehand 45894/head
authorRishabh Dave <ridave@redhat.com>
Wed, 13 Apr 2022 05:03:25 +0000 (10:33 +0530)
committerRishabh Dave <ridave@redhat.com>
Tue, 26 Apr 2022 02:38:43 +0000 (08:08 +0530)
qa/tasks/vstart_runner.py runs src/stop.sh and src/vstart.sh if --create
is passed to it. Once in a few times, vstart_runner.py hangs on running
stop.sh. Running "ps -ef | grep ceph" shows that following command is
launched every time vstart_runner.py hangs at stop.sh -

  /usr/bin/python3.9 bin/ceph -c <path-to-ceph-repo>/build/ceph.conf tell mds.* client ls

Every time an instance of vstart_runner.py hangs at execution of
stop.sh, a new "ceph tell mds.* client ls" command is launched. This
doesn't happen when stop.sh is run manually. I suspect some issue lies
between this commmand in stop.sh and Python subprocess module.

Anyways, a simple fix is to not to run this command when ceph-mds daemon(s)
are not present on the system.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/stop.sh

index 71bc40986d1080efe0b0f8131a1ff24d01c2fff8..60b6216b6840a5720300061adfc18c26debfef47 100755 (executable)
@@ -104,8 +104,11 @@ do_umountall() {
     done
 
     #Get fuse mounts of the cluster
-    CEPH_FUSE_MNTS=$("${CEPH_BIN}"/ceph -c $conf_fn tell mds.* client ls 2>/dev/null | grep mount_point | tr -d '",' | awk '{print $2}')
-    [ -n "$CEPH_FUSE_MNTS" ] && sudo umount -f $CEPH_FUSE_MNTS
+    num_of_ceph_mdss=$(ps -e | grep \ ceph-mds$ | wc -l)
+    if test num_of_ceph_mdss -ne 0; then
+        CEPH_FUSE_MNTS=$("${CEPH_BIN}"/ceph -c $conf_fn tell mds.* client ls 2>/dev/null | grep mount_point | tr -d '",' | awk '{print $2}')
+        [ -n "$CEPH_FUSE_MNTS" ] && sudo umount -f $CEPH_FUSE_MNTS
+    fi
 }
 
 usage="usage: $0 [all] [mon] [mds] [osd] [rgw] [nfs] [--crimson] [--cephadm]\n"