]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: RGWBucketSyncStatusManager uses existing async_rados
authorCasey Bodley <cbodley@redhat.com>
Tue, 29 Nov 2016 22:15:27 +0000 (17:15 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 29 Nov 2016 22:17:34 +0000 (17:17 -0500)
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 <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h

index 9d68ba72bef20e5858fb249f737250e1376c0f93..48276e79150e38ca5fe47d812db358001b37994a 100644 (file)
@@ -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);
index 9747c9b09f87a249350bce4d9eee8dd40a273e8e..118a7a9bd67fdb166f94b054353a6f92cb1aabfe 100644 (file)
@@ -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),