Skip to content

Commit

Permalink
qa/cephfs: kill mount if it gets evicted by mds
Browse files Browse the repository at this point in the history
otherwise, teardown() hange at umount

Fixes: http://tracker.ceph.com/issues/21275
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
  • Loading branch information
ukernel committed Sep 13, 2017
1 parent 8433ced commit 98d86a0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions qa/tasks/cephfs/test_client_recovery.py
Expand Up @@ -395,14 +395,21 @@ def test_filelock_eviction(self):
self.assertFalse(lock_holder.finished)
self.assertFalse(lock_taker.finished)

mount_a_client_id = self.mount_a.get_global_id()
self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id])
try:
mount_a_client_id = self.mount_a.get_global_id()
self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id])

# Evicting mount_a should let mount_b's attepmt to take the lock
# suceed
self.wait_until_true(
lambda: lock_taker.finished,
timeout=10)
# Evicting mount_a should let mount_b's attempt to take the lock
# succeed
self.wait_until_true(lambda: lock_taker.finished, timeout=10)
finally:
# teardown() doesn't quite handle this case cleanly, so help it out
self.mount_a.kill()
self.mount_a.kill_cleanup()

# Bring the client back
self.mount_a.mount()
self.mount_a.wait_until_mounted()

def test_dir_fsync(self):
self._test_fsync(True);
Expand Down

0 comments on commit 98d86a0

Please sign in to comment.