rgw: rados crs, explicit cleanup

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2016-05-03 12:01:55 -07:00
parent 7ada4df124
commit 1c876eb387
2 changed files with 47 additions and 1 deletions

View 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;
}
}

View 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;