From 296d89b0463ee3aad8dfb50b0e41a27e2c852ddb Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 6 Oct 2018 10:32:18 -0700 Subject: [PATCH] qa: use timeout for fs asok operations Otherwise a bug preventing an asok operation from completing will cause the entire job to fail. Fixes: http://tracker.ceph.com/issues/36335 Signed-off-by: Patrick Donnelly --- qa/tasks/cephfs/filesystem.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index cd18c40f61f..8764753c21c 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -172,8 +172,10 @@ class CephCluster(object): del self._ctx.ceph['ceph'].conf[subsys][key] write_conf(self._ctx) - def json_asok(self, command, service_type, service_id): - proc = self.mon_manager.admin_socket(service_type, service_id, command) + def json_asok(self, command, service_type, service_id, timeout=None): + if timeout is None: + timeout = 15*60 + proc = self.mon_manager.admin_socket(service_type, service_id, command, timeout=timeout) response_data = proc.stdout.getvalue() log.info("_json_asok output: {0}".format(response_data)) if response_data.strip(): @@ -909,15 +911,15 @@ class Filesystem(MDSCluster): return version - def mds_asok(self, command, mds_id=None): + def mds_asok(self, command, mds_id=None, timeout=None): if mds_id is None: mds_id = self.get_lone_mds_id() - return self.json_asok(command, 'mds', mds_id) + return self.json_asok(command, 'mds', mds_id, timeout=timeout) - def rank_asok(self, command, rank=0, status=None): + def rank_asok(self, command, rank=0, status=None, timeout=None): info = self.get_rank(rank=rank, status=status) - return self.json_asok(command, 'mds', info['name']) + return self.json_asok(command, 'mds', info['name'], timeout=timeout) def read_cache(self, path, depth=None): cmd = ["dump", "tree", path]