]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/ceph-fuse: If umount fails, abort and cleanup
authorSam Lang <sam.lang@inktank.com>
Wed, 14 Nov 2012 20:07:16 +0000 (14:07 -0600)
committerSam Lang <sam.lang@inktank.com>
Wed, 14 Nov 2012 20:51:03 +0000 (14:51 -0600)
Signed-off-by: Sam Lang <sam.lang@inktank.com>
teuthology/task/ceph-fuse.py

index ee619c953e75c2617c333b6ac4e61d5193b0681a..555ccaa5e5d47fb996f9da6de64285b39a267fc2 100644 (file)
@@ -126,13 +126,35 @@ def task(ctx, config):
         log.info('Unmounting ceph-fuse clients...')
         for id_, remote in clients:
             mnt = os.path.join('/tmp/cephtest', 'mnt.{id}'.format(id=id_))
-            remote.run(
-                args=[
-                    'fusermount',
-                    '-u',
-                    mnt,
-                    ],
-                )
+            try:
+              remote.run(
+                  args=[
+                      'fusermount',
+                      '-u',
+                      mnt,
+                      ],
+                  )
+            except CommandFailedError as e:
+              # abort the fuse mount, killing all hung processes
+              remote.run(
+                  args=[
+                      'echo',
+                      '1',
+                      run.Raw('>'),
+                      run.Raw('/sys/fs/fuse/connections/*/abort'),
+                      ],
+                 )
+              # make sure its unmounted
+              remote.run(
+                  args=[
+                      'sudo',
+                      'umount',
+                      '-l',
+                      '-f',
+                      mnt,
+                      ],
+                  )
+
         run.wait(fuse_daemons.itervalues())
 
         for id_, remote in clients: