]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: tear down on mount() failure 13282/head
authorJohn Spray <john.spray@redhat.com>
Mon, 6 Feb 2017 22:52:17 +0000 (22:52 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 6 Feb 2017 22:53:21 +0000 (22:53 +0000)
There were some cases where we would leave a mountpoint
that would cause the teuthology teardown to get hung up
when it tried to look inside cephtest/

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

index 896ca5c67fd55abeadc0af65e7f7ace4d746cada..872412f912dec178c6007f28b602aae6cb048f1c 100644 (file)
@@ -23,6 +23,18 @@ class FuseMount(CephFSMount):
         self._fuse_conn = None
 
     def mount(self, mount_path=None, mount_fs_name=None):
+        try:
+            return self._mount(mount_path, mount_fs_name)
+        except RuntimeError:
+            # Catch exceptions by the mount() logic (i.e. not remote command
+            # failures) and ensure the mount is not left half-up.
+            # Otherwise we might leave a zombie mount point that causes
+            # anyone traversing cephtest/ to get hung up on.
+            log.warn("Trying to clean up after failed mount")
+            self.umount_wait(force=True)
+            raise
+
+    def _mount(self, mount_path, mount_fs_name):
         log.info("Client client.%s config is %s" % (self.client_id, self.client_config))
 
         daemon_signal = 'kill'