]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix a few more leaks
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 13 Jan 2016 02:20:32 +0000 (18:20 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:54 +0000 (16:13 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_coroutine.cc
src/rgw/rgw_data_sync.cc
src/rgw/rgw_sync.cc

index 7738832dcf86d6d0ba87e248dd94951ae05c7704..b01be51fce883e6c5e2f0728e4b90f26ab74b72a 100644 (file)
@@ -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;
 }
index 66045a06f73e08323c46ac7a618e96e1bdbcc380..986aca6d6eda1f4683e38884e031f50213d71997 100644 (file)
@@ -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();
 
index a3d421857dd6729e939f4d1a04bfea390686f7c0..a4de25dba857fc9be3f5ffc550ab7fe1e229a079 100644 (file)
@@ -356,15 +356,20 @@ class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest {
   list<cls_log_entry> *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;