From f4cb42c3ced2f33c46a4b02ca67f91b7987ffb3b Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 15 Aug 2014 00:46:36 +0200 Subject: [PATCH] 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 --- tasks/ceph.py | 8 ++++++++ tasks/rados.py | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tasks/ceph.py b/tasks/ceph.py index abc3653743cf..2abc11019d84 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 6cc52bdaaf1d..3d44fdff1c3e 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'))): -- 2.47.3