From: Loic Dachary Date: Thu, 14 Aug 2014 22:46:36 +0000 (+0200) Subject: initialize ctx.manager in ceph.py X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4cb42c3ced2f33c46a4b02ca67f91b7987ffb3b;p=ceph.git initialize ctx.manager in ceph.py instead of rados.py because ceph.py is only run once where rados.py could be run multiple time, leading to race conditions http://tracker.ceph.com/issues/9027 Fixes: #9027 Signed-off-by: Loic Dachary (cherry picked from commit 9782465c872b25710af278c701e15078a3748d03) Conflicts: tasks/rados.py because if not hasattr(ctx, 'manager'): was not at the same place --- diff --git a/tasks/ceph.py b/tasks/ceph.py index abc3653743c..2abc11019d8 100644 --- a/tasks/ceph.py +++ b/tasks/ceph.py @@ -12,6 +12,7 @@ import os import json import time +from ceph_manager import CephManager from teuthology import misc as teuthology from teuthology import contextutil from teuthology.orchestra import run @@ -1184,6 +1185,13 @@ def task(ctx, config): try: if config.get('wait-for-healthy', True): healthy(ctx=ctx, config=None) + first_mon = teuthology.get_first_mon(ctx, config) + (mon,) = ctx.cluster.only(first_mon).remotes.iterkeys() + ctx.manager = CephManager( + mon, + ctx=ctx, + logger=log.getChild('ceph_manager'), + ) yield finally: osd_scrub_pgs(ctx, config) diff --git a/tasks/rados.py b/tasks/rados.py index 6cc52bdaaf1..3d44fdff1c3 100644 --- a/tasks/rados.py +++ b/tasks/rados.py @@ -4,7 +4,6 @@ Rados modle-based integration tests import contextlib import logging import gevent -from ceph_manager import CephManager from teuthology import misc as teuthology from teuthology.orchestra import run @@ -118,15 +117,6 @@ def task(ctx, config): def thread(): """Thread spawned by gevent""" - if not hasattr(ctx, 'manager'): - first_mon = teuthology.get_first_mon(ctx, config) - (mon,) = ctx.cluster.only(first_mon).remotes.iterkeys() - ctx.manager = CephManager( - mon, - ctx=ctx, - 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'))):