tasks/cephfs: optionally check result of fuse proc on umount

For cases where the client process successfully unmounts,
but then crashes before finishing.

Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2016-02-10 12:20:33 +00:00
parent 9fd891f078
commit 08c28765ce
3 changed files with 16 additions and 4 deletions

View File

@ -236,11 +236,13 @@ class FuseMount(CephFSMount):
assert not self.is_mounted()
self._fuse_conn = None
def umount_wait(self, force=False):
def umount_wait(self, force=False, require_clean=False):
"""
:param force: Complete cleanly even if the MDS is offline
"""
if force:
assert not require_clean # mutually exclusive
# When we expect to be forcing, kill the ceph-fuse process directly.
# This should avoid hitting the more aggressive fallback killing
# in umount() which can affect other mounts too.
@ -261,7 +263,8 @@ class FuseMount(CephFSMount):
"indicates a bug within ceph-fuse.")
raise
except CommandFailedError:
pass
if require_clean:
raise
self.cleanup()

View File

@ -103,7 +103,7 @@ class KernelMount(CephFSMount):
def cleanup(self):
pass
def umount_wait(self, force=False):
def umount_wait(self, force=False, require_clean=False):
"""
Unlike the fuse client, the kernel client's umount is immediate
"""

View File

@ -41,7 +41,16 @@ class CephFSMount(object):
def umount(self):
raise NotImplementedError()
def umount_wait(self, force=False):
def umount_wait(self, force=False, require_clean=False):
"""
:param force: Expect that the mount will not shutdown cleanly: kill
it hard.
:param require_clean: Wait for the Ceph client associated with the
mount (e.g. ceph-fuse) to terminate, and
raise if it doesn't do so cleanly.
:return:
"""
raise NotImplementedError()
def kill_cleanup(self):