]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: rados crs, explicit cleanup
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 3 May 2016 19:01:55 +0000 (12:01 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 May 2016 21:36:40 +0000 (14:36 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h

index 398433c3df419174b0c7b694e1d1d5e1d49511e1..e812347121d94d08d0059968e4e5f330e5e54ba8 100644 (file)
@@ -309,6 +309,7 @@ void RGWSimpleRadosLockCR::request_cleanup()
 {
   if (req) {
     req->finish();
+    req = NULL;
   }
 }
 
@@ -345,6 +346,7 @@ void RGWSimpleRadosUnlockCR::request_cleanup()
 {
   if (req) {
     req->finish();
+    req = NULL;
   }
 }
 
@@ -639,6 +641,7 @@ void RGWStatObjCR::request_cleanup()
 {
   if (req) {
     req->finish();
+    req = NULL;
   }
 }
 
index 1f00931ba75d7b798aff3768493e63c85d583ef7..af0481ce99223bf864f4077a4116f9e3b11d7635 100644 (file)
@@ -196,10 +196,14 @@ public:
                                                 pattrs(NULL),
                                                result(_result),
                                                 req(NULL) { }
+  ~RGWSimpleRadosReadCR() {
+    request_cleanup();
+  }
                                                          
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -270,10 +274,14 @@ public:
                                                pool(_pool), oid(_oid),
                                                 pattrs(_pattrs),
                                                 req(NULL) { }
+  ~RGWSimpleRadosReadAttrsCR() {
+    request_cleanup();
+  }
                                                          
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -303,9 +311,14 @@ public:
     ::encode(_data, bl);
   }
 
+  ~RGWSimpleRadosWriteCR() {
+    request_cleanup();
+  }
+
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -342,10 +355,14 @@ public:
                                                pool(_pool), oid(_oid),
                                                 attrs(_attrs), req(NULL) {
   }
+  ~RGWSimpleRadosWriteAttrsCR() {
+    request_cleanup();
+  }
 
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -429,6 +446,9 @@ public:
                      const rgw_bucket& _pool, const string& _oid, const string& _lock_name,
                      const string& _cookie,
                      uint32_t _duration);
+  ~RGWSimpleRadosLockCR() {
+    request_cleanup();
+  }
   void request_cleanup();
 
   int send_request();
@@ -450,6 +470,9 @@ public:
   RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store,
                      const rgw_bucket& _pool, const string& _oid, const string& _lock_name,
                      const string& _cookie);
+  ~RGWSimpleRadosUnlockCR() {
+    request_cleanup();
+  }
   void request_cleanup();
 
   int send_request();
@@ -520,11 +543,15 @@ public:
             int _secs) : RGWSimpleCoroutine(cct), cct(_cct),
                          async_rados(_async_rados), lock(_lock), cond(_cond), secs(_secs), req(NULL) {
   }
+  ~RGWWaitCR() {
+    request_cleanup();
+  }
 
   void request_cleanup() {
-    wakeup();
     if (req) {
+      wakeup();
       req->finish();
+      req = NULL;
     }
   }
 
@@ -619,9 +646,13 @@ public:
                         RGWBucketInfo *_bucket_info) : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
                                                        bucket_name(_bucket_name), bucket_id(_bucket_id),
                                                        bucket_info(_bucket_info), req(NULL) {}
+  ~RGWGetBucketInstanceInfoCR() {
+    request_cleanup();
+  }
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -696,9 +727,14 @@ public:
                                        copy_if_newer(_if_newer), req(NULL) {}
 
 
+  ~RGWFetchRemoteObjCR() {
+    request_cleanup();
+  }
+
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -810,10 +846,14 @@ public:
       owner_display_name = *_owner_display_name;
     }
   }
+  ~RGWRemoveObjCR() {
+    request_cleanup();
+  }
 
   void request_cleanup() {
     if (req) {
       req->finish();
+      req = NULL;
     }
   }
 
@@ -934,6 +974,9 @@ class RGWStatObjCR : public RGWSimpleCoroutine {
          const rgw_obj& obj, uint64_t *psize = nullptr,
          real_time* pmtime = nullptr, uint64_t *pepoch = nullptr,
          RGWObjVersionTracker *objv_tracker = nullptr);
+  ~RGWStatObjCR() {
+    request_cleanup();
+  }
   void request_cleanup();
 
   int send_request() override;