From 27ba93bfad65b754fc1432a785148c1cf0eba40b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 11 Aug 2020 13:57:54 -0400 Subject: [PATCH] rgw: optional_yield support for REST client Signed-off-by: Casey Bodley --- src/rgw/rgw_rest_client.cc | 5 +++-- src/rgw/rgw_rest_client.h | 3 ++- src/rgw/rgw_rest_conn.cc | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index b6b315c23c7..55236a79b59 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -803,13 +803,14 @@ int RGWRESTStreamRWRequest::send(RGWHTTPManager *mgr) return 0; } -int RGWRESTStreamRWRequest::complete_request(string *etag, +int RGWRESTStreamRWRequest::complete_request(optional_yield y, + string *etag, real_time *mtime, uint64_t *psize, map *pattrs, map *pheaders) { - int ret = wait(null_yield); + int ret = wait(y); if (ret < 0) { return ret; } diff --git a/src/rgw/rgw_rest_client.h b/src/rgw/rgw_rest_client.h index 2628806ce13..31b7978f18d 100644 --- a/src/rgw/rgw_rest_client.h +++ b/src/rgw/rgw_rest_client.h @@ -176,7 +176,8 @@ public: int send_request(RGWAccessKey& key, map& extra_headers, const rgw_obj& obj, RGWHTTPManager *mgr); int send_request(RGWAccessKey *key, map& extra_headers, const string& resource, RGWHTTPManager *mgr, bufferlist *send_data = nullptr /* optional input data */); - int complete_request(string *etag = nullptr, + int complete_request(optional_yield y, + string *etag = nullptr, real_time *mtime = nullptr, uint64_t *psize = nullptr, map *pattrs = nullptr, diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index bb7ecda23f4..70b3a48fedb 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -161,7 +161,7 @@ int RGWRESTConn::put_obj_async(const rgw_user& uid, rgw::sal::RGWObject* obj, ui int RGWRESTConn::complete_request(RGWRESTStreamS3PutObj *req, string& etag, real_time *mtime) { - int ret = req->complete_request(&etag, mtime); + int ret = req->complete_request(null_yield, &etag, mtime); delete req; return ret; @@ -302,7 +302,7 @@ int RGWRESTConn::complete_request(RGWRESTStreamRWRequest *req, map *pattrs, map *pheaders) { - int ret = req->complete_request(etag, mtime, psize, pattrs, pheaders); + int ret = req->complete_request(null_yield, etag, mtime, psize, pattrs, pheaders); delete req; return ret; @@ -343,7 +343,7 @@ int RGWRESTConn::get_resource(const string& resource, return ret; } - return req.complete_request(); + return req.complete_request(null_yield); } RGWRESTReadResource::RGWRESTReadResource(RGWRESTConn *_conn, @@ -388,7 +388,7 @@ int RGWRESTReadResource::read() return ret; } - return req.complete_request(); + return req.complete_request(null_yield); } int RGWRESTReadResource::aio_read() @@ -449,7 +449,7 @@ int RGWRESTSendResource::send(bufferlist& outbl) return ret; } - return req.complete_request(); + return req.complete_request(null_yield); } int RGWRESTSendResource::aio_send(bufferlist& outbl) -- 2.39.5