From: Jos Collin Date: Thu, 6 Jun 2019 11:20:18 +0000 (+0530) Subject: qa/tasks: start DaemonWatchdog when ceph starts X-Git-Tag: v15.1.0~1819^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08b99eef277b00a3ea423cbf085bd114a805813f;p=ceph.git qa/tasks: start DaemonWatchdog when ceph starts * Start DaemonWatchdog when ceph starts * Drop the DaemonWatchdog starting in mds_thrash.py * Bring the thrashers in mds_thrash.py into the context Fixes: http://tracker.ceph.com/issues/10369 Signed-off-by: Jos Collin --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 38c1a3ae4a026..cf8931793d8ab 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -27,6 +27,7 @@ from teuthology import exceptions from teuthology.orchestra import run import ceph_client as cclient from teuthology.orchestra.daemon import DaemonGroup +from tasks.daemonwatchdog import DaemonWatchdog CEPH_ROLE_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rgw'] DATA_PATH = '/var/lib/ceph/{type_}/{cluster}-{id_}' @@ -416,6 +417,12 @@ def cephfs_setup(ctx, config): yield +@contextlib.contextmanager +def watchdog_setup(ctx, config): + ctx.ceph[config['cluster']].thrashers = [] + ctx.ceph[config['cluster']].watchdog = DaemonWatchdog(ctx, config, ctx.ceph[config['cluster']].thrashers) + ctx.ceph[config['cluster']].watchdog.start() + yield def get_mons(roles, ips, cluster_name, mon_bind_msgr2=False, @@ -1672,6 +1679,8 @@ def stop(ctx, config): cluster, type_, id_ = teuthology.split_role(role) ctx.daemons.get_daemon(type_, id_, cluster).stop() + ctx.ceph[config['cluster']].watchdog.stop() + ctx.ceph[config['cluster']].watchdog.join() yield @@ -1909,6 +1918,7 @@ def task(ctx, config): lambda: create_rbd_pool(ctx=ctx, config=config), lambda: cephfs_setup(ctx=ctx, config=config), lambda: run_daemon(ctx=ctx, config=config, type_='mds'), + lambda: watchdog_setup(ctx=ctx, config=config), ] with contextutil.nested(*subtasks): diff --git a/qa/tasks/mds_thrash.py b/qa/tasks/mds_thrash.py index 859446ed57ceb..a4ef8d9850534 100644 --- a/qa/tasks/mds_thrash.py +++ b/qa/tasks/mds_thrash.py @@ -14,7 +14,6 @@ from gevent.event import Event from teuthology import misc as teuthology from tasks.cephfs.filesystem import MDSCluster, Filesystem -from tasks.daemonwatchdog import DaemonWatchdog log = logging.getLogger(__name__) @@ -409,29 +408,25 @@ def task(ctx, config): status = mds_cluster.status() log.info('Ready to start thrashing') - thrashers = [] - - watchdog = DaemonWatchdog(ctx, manager, config, thrashers) - watchdog.start() - manager.wait_for_clean() assert manager.is_clean() + + if 'cluster' not in config: + config['cluster'] = 'ceph' + for fs in status.get_filesystems(): thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fs['id']), fs['mdsmap']['max_mds']) thrasher.start() - thrashers.append(thrasher) + ctx.ceph[config['cluster']].thrashers.append(thrasher) try: log.debug('Yielding') yield finally: log.info('joining mds_thrashers') - for thrasher in thrashers: + for thrasher in ctx.ceph[config['cluster']].thrashers: thrasher.stop() if thrasher.e: raise RuntimeError('error during thrashing') thrasher.join() log.info('done joining') - - watchdog.stop() - watchdog.join()