]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tasks/cephfs: optionally check result of fuse proc on umount
authorJohn Spray <john.spray@redhat.com>
Wed, 10 Feb 2016 12:20:33 +0000 (12:20 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 10 Feb 2016 12:22:05 +0000 (12:22 +0000)
For cases where the client process successfully unmounts,
but then crashes before finishing.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/fuse_mount.py
tasks/cephfs/kernel_mount.py
tasks/cephfs/mount.py

index e6631b547a615a577abcdc7c054e55087b2ad139..e90a04817eecb7298dabe986d8d926e7bc14b069 100644 (file)
@@ -236,11 +236,13 @@ class FuseMount(CephFSMount):
         assert not self.is_mounted()
         self._fuse_conn = None
 
-    def umount_wait(self, force=False):
+    def umount_wait(self, force=False, require_clean=False):
         """
         :param force: Complete cleanly even if the MDS is offline
         """
         if force:
+            assert not require_clean  # mutually exclusive
+
             # When we expect to be forcing, kill the ceph-fuse process directly.
             # This should avoid hitting the more aggressive fallback killing
             # in umount() which can affect other mounts too.
@@ -261,7 +263,8 @@ class FuseMount(CephFSMount):
                       "indicates a bug within ceph-fuse.")
             raise
         except CommandFailedError:
-            pass
+            if require_clean:
+                raise
 
         self.cleanup()
 
index 00a48ec90c8e0323687a2b338d18194d79caaa7c..b26f3c66373751cdcff4a253d61d169475c6c496 100644 (file)
@@ -103,7 +103,7 @@ class KernelMount(CephFSMount):
     def cleanup(self):
         pass
 
-    def umount_wait(self, force=False):
+    def umount_wait(self, force=False, require_clean=False):
         """
         Unlike the fuse client, the kernel client's umount is immediate
         """
index f714238fffb93fbc4aed6eeb85abf2920a3b3784..a4c4df66329cf10d7319540016209aafdd5f1c53 100644 (file)
@@ -41,7 +41,16 @@ class CephFSMount(object):
     def umount(self):
         raise NotImplementedError()
 
-    def umount_wait(self, force=False):
+    def umount_wait(self, force=False, require_clean=False):
+        """
+
+        :param force: Expect that the mount will not shutdown cleanly: kill
+                      it hard.
+        :param require_clean: Wait for the Ceph client associated with the
+                              mount (e.g. ceph-fuse) to terminate, and
+                              raise if it doesn't do so cleanly.
+        :return:
+        """
         raise NotImplementedError()
 
     def kill_cleanup(self):