]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: fixes to FuseMount
authorJohn Spray <john.spray@redhat.com>
Thu, 3 Dec 2015 00:17:32 +0000 (00:17 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 5 Jan 2016 18:58:01 +0000 (18:58 +0000)
This was getting stressed in new ways by
TestSessionMap.test_session_reject, which
has a mount that fails initially.

Two changes here:
 * Raise CommandFailedError instead of RuntimeError when
   a mount fails (i.e. catch process termination instead
   of timing out on /sys/ population)
 * Generalise error handling on umount, so that we only
   raise the exception on an umount failure if the mount
   appears to really not be unmounted.  There is some
   EINVAL corner case that was getting triggered by the test.

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

index 09c9c110119ac4cd279a5a9f897dd912503ec79a..9226e403f9c5b30c5e0bd47719e82af2908d293c 100644 (file)
@@ -110,6 +110,10 @@ class FuseMount(CephFSMount):
 
         post_mount_conns = list_connections()
         while len(post_mount_conns) <= len(pre_mount_conns):
+            if self.fuse_daemon.finished:
+                # Did mount fail?  Raise the CommandFailedError instead of
+                # hitting the "failed to populate /sys/" timeout
+                self.fuse_daemon.wait()
             time.sleep(1)
             waited += 1
             if waited > timeout:
@@ -224,10 +228,7 @@ class FuseMount(CephFSMount):
                     stderr=stderr
                 )
             except CommandFailedError:
-                if "not found" in stderr.getvalue():
-                    # Missing mount point, so we are unmounted already, yay.
-                    pass
-                else:
+                if self.is_mounted():
                     raise
 
         assert not self.is_mounted()