From 13f0c9f534d0a9df362bb86ab546648fa046c104 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 13 Sep 2017 16:34:40 +0800 Subject: [PATCH] qa/cephfs: kill mount if it gets evicted by mds otherwise, teardown() hange at umount Fixes: http://tracker.ceph.com/issues/21275 Signed-off-by: "Yan, Zheng" (cherry picked from commit 98d86a075242f0c4576814db15cc3f8fd8e06017) --- qa/tasks/cephfs/test_client_recovery.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index 4940ab89b7cb..fd58c1427338 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -395,14 +395,21 @@ class TestClientRecovery(CephFSTestCase): 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); -- 2.47.3