From 05065dff10ead2a7ddcc7a5845573ab5dc63287e Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Wed, 14 Nov 2012 14:07:16 -0600 Subject: [PATCH] task/ceph-fuse: If umount fails, abort and cleanup Signed-off-by: Sam Lang --- teuthology/task/ceph-fuse.py | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/teuthology/task/ceph-fuse.py b/teuthology/task/ceph-fuse.py index ee619c953e75c..555ccaa5e5d47 100644 --- a/teuthology/task/ceph-fuse.py +++ b/teuthology/task/ceph-fuse.py @@ -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: -- 2.39.5