rgw: more leak fixes

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2016-01-07 16:17:12 -08:00
parent 9ffa3e20bd
commit 46f1ee548d
3 changed files with 14 additions and 4 deletions

View 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)

View 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;

View 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;