]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: more leak fixes
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jan 2016 00:17:12 +0000 (16:17 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:53 +0000 (16:13 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h
src/rgw/rgw_data_sync.cc

index 107102848f22aa03533fa2b900a79b0319a98c76..62b8c9f4f6c902a0c3b488aa416a66605f298378 100644 (file)
@@ -90,6 +90,11 @@ void RGWCompletionManager::_wakeup(void *opaque)
   }
 }
 
+RGWCoroutine::~RGWCoroutine() {
+  for (auto stack : spawned.entries) {
+    stack->put();
+  }
+}
 
 void RGWCoroutine::set_io_blocked(bool flag) {
   stack->set_io_blocked(flag);
@@ -142,6 +147,10 @@ RGWCoroutinesStack::~RGWCoroutinesStack()
   for (auto op : ops) {
     op->put();
   }
+
+  for (auto stack : spawned.entries) {
+    stack->put();
+  }
 }
 
 int RGWCoroutinesStack::operate(RGWCoroutinesEnv *_env)
index c976ed7e3fcb626185e2daed20cdba538ceec0f1..1815fa8ab0a003471f9b182812efbd23377193f3 100644 (file)
@@ -207,7 +207,7 @@ protected:
 
 public:
   RGWCoroutine(CephContext *_cct) : status(_cct), _yield_ret(false), cct(_cct), stack(NULL), retcode(0), state(RGWCoroutine_Run) {}
-  virtual ~RGWCoroutine() {}
+  virtual ~RGWCoroutine();
 
   virtual int operate() = 0;
 
index cfe1199403e36a38a993a70e715599b200a03178..8b837cbcb4623f210d88ff979a369f7ef15c0c77 100644 (file)
@@ -65,7 +65,7 @@ class RGWReadDataSyncStatusCoroutine : public RGWSimpleRadosReadCR<rgw_data_sync
 
   rgw_data_sync_status *sync_status;
 
-  list<RGWCoroutinesStack *> crs;
+  list<RGWSimpleRadosReadCR<rgw_data_sync_marker> *> crs;
 
 public:
   RGWReadDataSyncStatusCoroutine(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store,
@@ -94,8 +94,9 @@ int RGWReadDataSyncStatusCoroutine::handle_data(rgw_data_sync_info& data)
 
   map<uint32_t, rgw_data_sync_marker>& markers = sync_status->sync_markers;
   for (int i = 0; i < (int)data.num_shards; i++) {
-    RGWCoroutinesStack *cr = spawn(new RGWSimpleRadosReadCR<rgw_data_sync_marker>(async_rados, store, obj_ctx, store->get_zone_params().log_pool,
-                                                    RGWDataSyncStatusManager::shard_obj_name(source_zone, i), &markers[i]), true);
+    RGWSimpleRadosReadCR<rgw_data_sync_marker> *cr = new RGWSimpleRadosReadCR<rgw_data_sync_marker>(async_rados, store, obj_ctx, store->get_zone_params().log_pool,
+                                                    RGWDataSyncStatusManager::shard_obj_name(source_zone, i), &markers[i]);
+    spawn(cr, true);
     crs.push_back(cr);
   }
   return 0;