From 3ad2c2a8143ef527732e344089bbce2c75a5c2c7 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 29 Nov 2016 17:15:27 -0500 Subject: [PATCH] rgw: RGWBucketSyncStatusManager uses existing async_rados RGWBucketSyncStatusManager was creating its own RGWAsyncRadosProcessor and failing to clean it up on destruction. A recent change turned global_init()'s return value into an intrusive_ptr to guarantee that our CephContext is freed, and this triggered an assertion that all worker threads were shut down Fixes: http://tracker.ceph.com/issues/18083 Signed-off-by: Casey Bodley --- src/rgw/rgw_data_sync.cc | 5 ++--- src/rgw/rgw_data_sync.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 9d68ba72bef20..48276e79150e3 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2762,9 +2762,6 @@ int RGWBucketSyncStatusManager::init() return -EINVAL; } - async_rados = new RGWAsyncRadosProcessor(store, store->ctx()->_conf->rgw_num_async_rados_threads); - async_rados->start(); - int ret = http_manager.set_threaded(); if (ret < 0) { ldout(store->ctx(), 0) << "failed in http_manager.set_threaded() ret=" << ret << dendl; @@ -2795,6 +2792,8 @@ int RGWBucketSyncStatusManager::init() int effective_num_shards = (num_shards ? num_shards : 1); + auto async_rados = store->get_async_rados(); + for (int i = 0; i < effective_num_shards; i++) { RGWRemoteBucketLog *l = new RGWRemoteBucketLog(store, this, async_rados, &http_manager); ret = l->init(source_zone, conn, bucket, (num_shards ? i : -1), error_logger, sync_module); diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 9747c9b09f87a..118a7a9bd67fd 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -479,7 +479,6 @@ class RGWBucketSyncStatusManager { RGWCoroutinesManager cr_mgr; - RGWAsyncRadosProcessor *async_rados; RGWHTTPManager http_manager; string source_zone; @@ -504,7 +503,6 @@ public: RGWBucketSyncStatusManager(RGWRados *_store, const string& _source_zone, const rgw_bucket& bucket) : store(_store), cr_mgr(_store->ctx(), _store->get_cr_registry()), - async_rados(NULL), http_manager(store->ctx(), cr_mgr.get_completion_mgr()), source_zone(_source_zone), conn(NULL), error_logger(NULL), -- 2.39.5