Skip to content

Commit

Permalink
rgw: rados crs, explicit cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed May 9, 2016
1 parent 7ada4df commit 1c876eb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/rgw/rgw_cr_rados.cc
Expand Up @@ -309,6 +309,7 @@ void RGWSimpleRadosLockCR::request_cleanup()
{
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -345,6 +346,7 @@ void RGWSimpleRadosUnlockCR::request_cleanup()
{
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -639,6 +641,7 @@ void RGWStatObjCR::request_cleanup()
{
if (req) {
req->finish();
req = NULL;
}
}

Expand Down
45 changes: 44 additions & 1 deletion src/rgw/rgw_cr_rados.h
Expand Up @@ -196,10 +196,14 @@ class RGWSimpleRadosReadCR : public RGWSimpleCoroutine {
pattrs(NULL),
result(_result),
req(NULL) { }
~RGWSimpleRadosReadCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -270,10 +274,14 @@ class RGWSimpleRadosReadAttrsCR : public RGWSimpleCoroutine {
pool(_pool), oid(_oid),
pattrs(_pattrs),
req(NULL) { }
~RGWSimpleRadosReadAttrsCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -303,9 +311,14 @@ class RGWSimpleRadosWriteCR : public RGWSimpleCoroutine {
::encode(_data, bl);
}

~RGWSimpleRadosWriteCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -342,10 +355,14 @@ class RGWSimpleRadosWriteAttrsCR : public RGWSimpleCoroutine {
pool(_pool), oid(_oid),
attrs(_attrs), req(NULL) {
}
~RGWSimpleRadosWriteAttrsCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -429,6 +446,9 @@ class RGWSimpleRadosLockCR : public RGWSimpleCoroutine {
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();
Expand All @@ -450,6 +470,9 @@ class RGWSimpleRadosUnlockCR : public RGWSimpleCoroutine {
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();
Expand Down Expand Up @@ -520,11 +543,15 @@ class RGWWaitCR : public RGWSimpleCoroutine {
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;
}
}

Expand Down Expand Up @@ -619,9 +646,13 @@ class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine {
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;
}
}

Expand Down Expand Up @@ -696,9 +727,14 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
copy_if_newer(_if_newer), req(NULL) {}


~RGWFetchRemoteObjCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -810,10 +846,14 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine {
owner_display_name = *_owner_display_name;
}
}
~RGWRemoveObjCR() {
request_cleanup();
}

void request_cleanup() {
if (req) {
req->finish();
req = NULL;
}
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1c876eb

Please sign in to comment.