From 8730db190762c6517bf8ca00a7e39fb70915a91b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 13 Jun 2013 22:27:50 -0700 Subject: [PATCH] rados: fix up for parallel work - use a separate pool for each client - create pool at start, destroy pool at end - use all clients, if not explicitly specified Signed-off-by: Sage Weil --- teuthology/task/rados.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/teuthology/task/rados.py b/teuthology/task/rados.py index e316c11831ae1..a6f96595737b0 100644 --- a/teuthology/task/rados.py +++ b/teuthology/task/rados.py @@ -89,25 +89,29 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) + clients = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] + log.info('clients are %s' % clients) for i in range(int(config.get('runs', '1'))): log.info("starting run %s out of %s", str(i), config.get('runs', '1')) - ctx.manager.remove_pool('data') - ctx.manager.create_pool('data') + pool = 'radosmodel-%d' % i + ctx.manager.create_pool(pool) tests = {} - for role in config.get('clients', ['client.0']): + for role in config.get('clients', clients): assert isinstance(role, basestring) PREFIX = 'client.' assert role.startswith(PREFIX) id_ = role[len(PREFIX):] (remote,) = ctx.cluster.only(role).remotes.iterkeys() proc = remote.run( - args=["CEPH_CLIENT_ID={id_}".format(id_=id_)] + args, + args=["CEPH_CLIENT_ID={id_}".format(id_=id_)] + args + + ["--pool", pool], logger=log.getChild("rados.{id}".format(id=id_)), stdin=run.PIPE, wait=False ) tests[id_] = proc run.wait(tests.itervalues()) + ctx.manager.remove_pool(pool) running = gevent.spawn(thread) -- 2.39.5