Skip to content

Commit

Permalink
Merge pull request #13282 from jcsp/wip-fuse-mount-teardown
Browse files Browse the repository at this point in the history
tasks/cephfs: tear down on mount() failure

Reviewed-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
John Spray committed Feb 28, 2017
2 parents 1c73322 + 6203f33 commit 39204ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qa/tasks/cephfs/fuse_mount.py
Expand Up @@ -23,6 +23,18 @@ def __init__(self, client_config, test_dir, client_id, client_remote):
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'
Expand Down

0 comments on commit 39204ab

Please sign in to comment.