From: Yehuda Sadeh Date: Wed, 13 Jan 2016 02:20:32 +0000 (-0800) Subject: rgw: fix a few more leaks X-Git-Tag: v10.1.0~354^2~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b243075a29cb878c12dc448e4563fdd8d77c39c4;p=ceph.git rgw: fix a few more leaks Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 7738832dcf8..b01be51fce8 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -369,6 +369,10 @@ void RGWCoroutinesManager::report_error(RGWCoroutinesStack *op) if (!op) { return; } + string err = op->error_str(); + if (err.empty()) { + return; + } #warning need to have error logging infrastructure that logs on backend lderr(cct) << "ERROR: failed operation: " << op->error_str() << dendl; } diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 66045a06f73..986aca6d6ed 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1250,7 +1250,6 @@ int RGWRemoteDataLog::run_sync(int num_shards, rgw_data_sync_status& sync_status } lock.get_write(); - data_sync_cr->put(); data_sync_cr = NULL; lock.unlock(); diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index a3d421857dd..a4de25dba85 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -356,15 +356,20 @@ class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest { list *entries; bool *truncated; - void *handle; protected: int _send_request() { utime_t from_time; utime_t end_time; + void *handle; + mdlog->init_list_entries(shard_id, from_time, end_time, *marker, &handle); - return mdlog->list_entries(handle, max_entries, *entries, marker, truncated); + int ret = mdlog->list_entries(handle, max_entries, *entries, marker, truncated); + + mdlog->complete_list_entries(handle); + + return ret; } public: RGWAsyncReadMDLogEntries(RGWAioCompletionNotifier *cn, RGWRados *_store, @@ -1087,6 +1092,11 @@ public: *new_marker = marker; } } + ~RGWCloneMetaLogCoroutine() { + if (http_op) { + http_op->put(); + } + } int operate(); @@ -1823,6 +1833,7 @@ int RGWCloneMetaLogCoroutine::state_send_rest_request() ldout(cct, 0) << "ERROR: failed to fetch mdlog data" << dendl; log_error() << "failed to send http operation: " << http_op->to_str() << " ret=" << ret << std::endl; http_op->put(); + http_op = NULL; return ret; } @@ -1836,9 +1847,11 @@ int RGWCloneMetaLogCoroutine::state_receive_rest_response() error_stream << "http operation failed: " << http_op->to_str() << " status=" << http_op->get_http_status() << std::endl; ldout(cct, 0) << "ERROR: failed to wait for op, ret=" << ret << dendl; http_op->put(); + http_op = NULL; return set_cr_error(ret); } http_op->put(); + http_op = NULL; ldout(cct, 20) << "remote mdlog, shard_id=" << shard_id << " num of shard entries: " << data.entries.size() << dendl;