Skip to content

Commit

Permalink
qa: use timeout for fs asok operations
Browse files Browse the repository at this point in the history
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 <pdonnell@redhat.com>
(cherry picked from commit 296d89b)
  • Loading branch information
batrick authored and ashishkumsingh committed Jan 6, 2019
1 parent 61e1861 commit 678f85e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qa/tasks/cephfs/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ def clear_ceph_conf(self, subsys, key):
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():
Expand Down Expand Up @@ -857,15 +859,15 @@ def get_journal_version(self):

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]
Expand Down

0 comments on commit 678f85e

Please sign in to comment.