mirror of
https://github.com/ceph/ceph
synced 2024-12-21 02:42:48 +00:00
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:
parent
9fd891f078
commit
08c28765ce
@ -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()
|
||||
|
||||
|
@ -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
|
||||
"""
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user