From 1c876eb3873692042c0af3644f8ee3ad15ffdbf5 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 3 May 2016 12:01:55 -0700 Subject: [PATCH] rgw: rados crs, explicit cleanup Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_cr_rados.cc | 3 +++ src/rgw/rgw_cr_rados.h | 45 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 398433c3df4..e812347121d 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -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; } } diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index 1f00931ba75..af0481ce992 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -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; -- 2.39.5