]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: pass DoutPrefixProvider into RGWHTTPClient
authorCasey Bodley <cbodley@redhat.com>
Thu, 20 Jun 2024 17:41:06 +0000 (13:41 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 2 Jul 2024 14:36:31 +0000 (10:36 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
22 files changed:
src/rgw/driver/rados/rgw_data_sync.cc
src/rgw/driver/rados/rgw_lc_tier.cc
src/rgw/driver/rados/rgw_notify.cc
src/rgw/driver/rados/rgw_pubsub_push.cc
src/rgw/driver/rados/rgw_pubsub_push.h
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_sync.cc
src/rgw/rgw_auth_keystone.cc
src/rgw/rgw_cr_rest.cc
src/rgw/rgw_cr_rest.h
src/rgw/rgw_http_client.cc
src/rgw/rgw_http_client.h
src/rgw/rgw_keystone.cc
src/rgw/rgw_kms.cc
src/rgw/rgw_opa.cc
src/rgw/rgw_rest_client.cc
src/rgw/rgw_rest_client.h
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_conn.h
src/rgw/rgw_rest_sts.cc
src/rgw/rgw_swift_auth.cc
src/test/rgw/test_http_manager.cc

index edf97d27975f54c1b7a3748733bc2599b1746147..151fd7fe84e869549d4a71476ebd64a2ee74c5cf 100644 (file)
@@ -277,7 +277,7 @@ public:
           return io_block(0);
         }
         yield {
-          op_ret = http_op->wait(shard_info, null_yield);
+          op_ret = http_op->wait(dpp, shard_info, null_yield);
           http_op->put();
         }
 
@@ -377,7 +377,7 @@ public:
         }
         yield {
           timer.reset();
-          op_ret = http_op->wait(&response, null_yield);
+          op_ret = http_op->wait(dpp, &response, null_yield);
           http_op->put();
         }
 
@@ -495,7 +495,7 @@ public:
   }
 
   int request_complete() override {
-    int ret = http_op->wait(result, null_yield);
+    int ret = http_op->wait(sync_env->dpp, result, null_yield);
     http_op->put();
     if (ret < 0 && ret != -ENOENT) {
       ldpp_dout(sync_env->dpp, 5) << "ERROR: failed to list remote datalog shard, ret=" << ret << dendl;
index eea5c9b01a7a2e060bb894059061625c84b4c9ba..64c55700eb2b51f1f337ae8459634f140698a606 100644 (file)
@@ -269,7 +269,7 @@ static int cloud_tier_get_object(RGWLCCloudTierCtx& tier_ctx, bool head,
   }
 
   /* fetch headers */
-  ret = tier_ctx.conn.complete_request(in_req, nullptr, nullptr, nullptr, nullptr, &headers, null_yield);
+  ret = tier_ctx.conn.complete_request(tier_ctx.dpp, in_req, nullptr, nullptr, nullptr, nullptr, &headers, null_yield);
   if (ret < 0 && ret != -ENOENT) {
     ldpp_dout(tier_ctx.dpp, 20) << "ERROR: " << __func__ << "(): conn.complete_request() returned ret=" << ret << dendl;
     return ret;
@@ -704,8 +704,7 @@ RGWGetDataCB *RGWLCCloudStreamPut::get_cb() {
 }
 
 int RGWLCCloudStreamPut::complete_request() {
-  int ret = conn.complete_request(out_req, etag, &obj_properties.mtime, null_yield);
-  return ret;
+  return conn.complete_request(dpp, out_req, etag, &obj_properties.mtime, null_yield);
 }
 
 /* Read local copy and write to Cloud endpoint */
index f138db1d92033e737e8c5ea0868222eaa5c96640..6c1fe53d7e37843316051da9f363095b49177875 100644 (file)
@@ -248,7 +248,7 @@ private:
                         << " retry_number: "
                         << entry_persistency_tracker.retires_num
                         << " current time: " << time_now << dendl;
-    const auto ret = push_endpoint->send(event_entry.event, yield);
+    const auto ret = push_endpoint->send(this, event_entry.event, yield);
     if (ret < 0) {
       ldpp_dout(this, 5) << "WARNING: push entry marker: " << entry.marker
                          << " failed. error: " << ret
@@ -1266,7 +1266,7 @@ int publish_commit(rgw::sal::Object* obj,
          dpp->get_cct());
         ldpp_dout(res.dpp, 20) << "INFO: push endpoint created: "
                               << topic.cfg.dest.push_endpoint << dendl;
-        const auto ret = push_endpoint->send(event_entry.event, res.yield);
+        const auto ret = push_endpoint->send(dpp, event_entry.event, res.yield);
         if (ret < 0) {
           ldpp_dout(dpp, 1)
               << "ERROR: failed to push sync notification event with error: "
index f2a7affcb0374253b7e85a8d0f7a897e069adfb1..eb7f854cca82a2825c3d6d9c9e61ae0710a3d2ac 100644 (file)
@@ -88,7 +88,8 @@ public:
     }
   }
 
-  int send(const rgw_pubsub_s3_event& event, optional_yield y) override {
+  int send(const DoutPrefixProvider* dpp, const rgw_pubsub_s3_event& event,
+           optional_yield y) override {
     std::shared_lock lock(s_http_manager_mutex);
     if (!s_http_manager) {
       ldout(cct, 1) << "ERROR: send failed. http endpoint manager not running" << dendl;
@@ -114,7 +115,7 @@ public:
     if (perfcounter) perfcounter->inc(l_rgw_pubsub_push_pending);
     auto rc = s_http_manager->add_request(&request);
     if (rc == 0) {
-      rc = request.wait(y);
+      rc = request.wait(dpp, y);
     }
     if (perfcounter) perfcounter->dec(l_rgw_pubsub_push_pending);
     // TODO: use read_bl to process return code and handle according to ack level
@@ -144,7 +145,7 @@ class Waiter {
   mutable std::condition_variable cond;
 
 public:
-  int wait(optional_yield y) {
+  int wait(const DoutPrefixProvider* dpp, optional_yield y) {
     std::unique_lock l{lock};
     if (done) {
       return ret;
@@ -247,7 +248,7 @@ public:
     }
   }
 
-  int send(const rgw_pubsub_s3_event& event, optional_yield y) override {
+  int send(const DoutPrefixProvider* dpp, const rgw_pubsub_s3_event& event, optional_yield y) override {
     if (ack_level == ack_level_t::None) {
       return amqp::publish(conn_id, topic, json_format_pubsub_event(event));
     } else {
@@ -262,7 +263,7 @@ public:
         // failed to publish, does not wait for reply
         return rc;
       }
-      return w->wait(y);
+      return w->wait(dpp, y);
     }
   }
 
@@ -320,7 +321,8 @@ public:
    }
  }
 
-  int send(const rgw_pubsub_s3_event& event, optional_yield y) override {
+  int send(const DoutPrefixProvider* dpp, const rgw_pubsub_s3_event& event,
+           optional_yield y) override {
     if (ack_level == ack_level_t::None) {
       return kafka::publish(conn_id, topic, json_format_pubsub_event(event));
     } else {
@@ -332,7 +334,7 @@ public:
         // failed to publish, does not wait for reply
         return rc;
       }
-      return w->wait(y);
+      return w->wait(dpp, y);
     }
   }
 
index bacebfba44c12e01494bb80ef5555135c1f18163..84207c5a1d77cb28248b58062dcf70dc5cc97449 100644 (file)
@@ -8,6 +8,7 @@
 #include "include/common_fwd.h"
 #include "common/async/yield_context.h"
 
+class DoutPrefixProvider;
 class RGWHTTPArgs;
 struct rgw_pubsub_s3_event;
 
@@ -28,7 +29,9 @@ public:
  
   // this method is used in order to send notification and wait for completion 
   // in async manner via a coroutine when invoked in the frontend environment
-  virtual int send(const rgw_pubsub_s3_event& event, optional_yield y) = 0;
+  virtual int send(const DoutPrefixProvider* dpp,
+                   const rgw_pubsub_s3_event& event,
+                   optional_yield y) = 0;
 
   // present as string
   virtual std::string to_str() const = 0;
index ce35ed20be4ec0b0e261199e1868535de72a9be2..c307b3a4ed807d3bbc9569dff24ae8954713b935 100644 (file)
@@ -4083,7 +4083,7 @@ int RGWRados::stat_remote_obj(const DoutPrefixProvider *dpp,
       return ret;
     }
 
-    ret = conn->complete_request(in_stream_req, nullptr, &set_mtime, psize,
+    ret = conn->complete_request(dpp, in_stream_req, nullptr, &set_mtime, psize,
                                  nullptr, pheaders, y);
     if (ret < 0) {
       if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
@@ -4318,7 +4318,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
       goto set_err_state;
     }
 
-    ret = conn->complete_request(in_stream_req, &etag, &set_mtime,
+    ret = conn->complete_request(rctx.dpp, in_stream_req, &etag, &set_mtime,
                                  &accounted_size, nullptr, nullptr, rctx.y);
     if (ret < 0) {
       if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
@@ -4578,7 +4578,7 @@ int RGWRados::copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
       return ret;
     }
 
-    ret = rest_master_conn->complete_request(out_stream_req, etag, mtime, y);
+    ret = rest_master_conn->complete_request(dpp, out_stream_req, etag, mtime, y);
     if (ret < 0) {
       if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
         ldpp_dout(dpp, 20) << __func__  << "(): failed to put_obj_async_init. retries=" << tries << dendl;
index 583e2d1098e1c2ae2c74923d640dbc8fd773655e..bd730dfd6c25996ddc0986969dea65b97cdd112b 100644 (file)
@@ -505,7 +505,7 @@ public:
           return io_block(0);
         }
         yield {
-          op_ret = http_op->wait(shard_info, null_yield);
+          op_ret = http_op->wait(dpp, shard_info, null_yield);
           http_op->put();
         }
 
@@ -586,7 +586,7 @@ public:
   }
 
   int request_complete() override {
-    int ret = http_op->wait(result, null_yield);
+    int ret = http_op->wait(sync_env->dpp, result, null_yield);
     http_op->put();
     if (ret < 0 && ret != -ENOENT) {
       ldpp_dout(sync_env->dpp, 5) << "ERROR: failed to list remote mdlog shard, ret=" << ret << dendl;
@@ -1089,7 +1089,7 @@ public:
           return io_block(0);
         }
         yield {
-          op_ret = http_op->wait(pbl, null_yield);
+          op_ret = http_op->wait(dpp, pbl, null_yield);
           http_op->put();
         }
 
@@ -2547,7 +2547,7 @@ int RGWCloneMetaLogCoroutine::state_send_rest_request(const DoutPrefixProvider *
 
 int RGWCloneMetaLogCoroutine::state_receive_rest_response()
 {
-  op_ret = http_op->wait(&data, null_yield);
+  op_ret = http_op->wait(sync_env->dpp, &data, null_yield);
   if (op_ret < 0 && op_ret != -EIO) {
     error_stream << "http operation failed: " << http_op->to_str() << " status=" << http_op->get_http_status() << std::endl;
     ldpp_dout(sync_env->dpp, 5) << "failed to wait for op, ret=" << op_ret << dendl;
index 0bcd1a32b0fe4ee91247c2b6ecb76a3915f95e98..9a0a973df43ea76743da795069e43341ac7aa754 100644 (file)
@@ -88,7 +88,7 @@ admin_token_retry:
 
   validate.set_url(url);
 
-  ret = validate.process(y);
+  ret = validate.process(dpp, y);
 
   /* NULL terminate for debug output. */
   token_body_bl.append(static_cast<char>(0));
@@ -464,7 +464,7 @@ EC2Engine::get_from_keystone(const DoutPrefixProvider* dpp, const std::string_vi
   validate.set_send_length(os.str().length());
 
   /* send request */
-  ret = validate.process(y);
+  ret = validate.process(dpp, y);
 
   /* if the supplied signature is wrong, we will get 401 from Keystone */
   if (validate.get_http_status() ==
@@ -544,7 +544,7 @@ auto EC2Engine::get_secret_from_keystone(const DoutPrefixProvider* dpp,
   secret.set_verify_ssl(cct->_conf->rgw_keystone_verify_ssl);
 
   /* send request */
-  ret = secret.process(y);
+  ret = secret.process(dpp, y);
 
   /* if the supplied access key isn't found, we will get 404 from Keystone */
   if (secret.get_http_status() ==
index 04920a1551b57a3c54c658167eb1807a90ebb648..fce41decb4119d621f93a7dc7e9c2096f2163303 100644 (file)
@@ -84,7 +84,8 @@ RGWStreamReadHTTPResourceCRF::~RGWStreamReadHTTPResourceCRF()
 {
   if (req) {
     req->cancel();
-    req->wait(null_yield);
+    auto dpp = NoDoutPrefix{cct, ceph_subsys_rgw};
+    req->wait(&dpp, null_yield);
     delete req;
   }
 }
@@ -188,7 +189,8 @@ RGWStreamWriteHTTPResourceCRF::~RGWStreamWriteHTTPResourceCRF()
 {
   if (req) {
     req->cancel();
-    req->wait(null_yield);
+    auto dpp = NoDoutPrefix{cct, ceph_subsys_rgw};
+    req->wait(&dpp, null_yield);
     delete req;
   }
 }
index 531d7ee68ef84a30938d7a250134eeac3d0f3d2f..4b9c0de445acb99c2f230ce6718515db166f6f39 100644 (file)
@@ -90,14 +90,13 @@ public:
 
 
 
-  virtual int wait_result() {
-    return http_op->wait(result, null_yield);
+  virtual int wait_result(const DoutPrefixProvider* dpp) {
+    return http_op->wait(dpp, result, null_yield);
   }
 
   int request_complete() override {
-    int ret;
-
-    ret = wait_result();
+    auto dpp = NoDoutPrefix{cct, ceph_subsys_rgw};
+    int ret = wait_result(&dpp);
 
     auto op = std::move(http_op); // release ref on return
     if (ret < 0) {
@@ -138,8 +137,8 @@ class RGWReadRESTResourceCR : public RGWReadRawRESTResourceCR {
     : RGWReadRawRESTResourceCR(_cct, _conn, _http_manager, _path, params, hdrs), result(_result)
   {}
 
-  int wait_result() override {
-    return http_op->wait(result, null_yield);
+  int wait_result(const DoutPrefixProvider* dpp) override {
+    return http_op->wait(dpp, result, null_yield);
   }
 
 };
@@ -207,12 +206,13 @@ class RGWSendRawRESTResourceCR: public RGWSimpleCoroutine {
   }
 
   int request_complete() override {
+    auto dpp = NoDoutPrefix{cct, ceph_subsys_rgw};
     int ret;
     if (result || err_result) {
-      ret = http_op->wait(result, null_yield, err_result);
+      ret = http_op->wait(&dpp, result, null_yield, err_result);
     } else {
       bufferlist bl;
-      ret = http_op->wait(&bl, null_yield);
+      ret = http_op->wait(&dpp, &bl, null_yield);
     }
     auto op = std::move(http_op); // release ref on return
     if (ret < 0) {
@@ -366,9 +366,9 @@ public:
   }
 
   int request_complete() override {
-    int ret;
+    auto dpp = NoDoutPrefix{cct, ceph_subsys_rgw};
     bufferlist bl;
-    ret = http_op->wait(&bl, null_yield);
+    int ret = http_op->wait(&dpp, &bl, null_yield);
     auto op = std::move(http_op); // release ref on return
     if (ret < 0) {
       error_stream << "http operation failed: " << op->to_str()
@@ -517,6 +517,7 @@ public:
 
 class RGWStreamWriteHTTPResourceCRF : public RGWStreamWriteResourceCRF {
 protected:
+  CephContext *cct;
   RGWCoroutinesEnv *env;
   RGWCoroutine *caller;
   RGWHTTPManager *http_manager;
@@ -546,10 +547,13 @@ public:
   RGWStreamWriteHTTPResourceCRF(CephContext *_cct,
                                RGWCoroutinesEnv *_env,
                                RGWCoroutine *_caller,
-                               RGWHTTPManager *_http_manager) : env(_env),
-                                                               caller(_caller),
-                                                               http_manager(_http_manager),
-                                                               write_drain_notify_cb(this) {}
+                               RGWHTTPManager *_http_manager)
+    : cct(_cct),
+      env(_env),
+      caller(_caller),
+      http_manager(_http_manager),
+      write_drain_notify_cb(this)
+  {}
   virtual ~RGWStreamWriteHTTPResourceCRF();
 
   int init() override {
index abbb9a04608af87f9fa89664a2250ce890e1e02c..83a83626db48e7783036db6615754cbc3598dcd3 100644 (file)
@@ -71,7 +71,7 @@ struct rgw_http_req_data : public RefCountedObject {
         }, token, ex);
   }
 
-  int wait(optional_yield y) {
+  int wait(const DoutPrefixProvider* dpp, optional_yield y) {
     std::unique_lock l{lock};
     if (done) {
       return ret;
@@ -534,9 +534,9 @@ static bool is_upload_request(const string& method)
 /*
  * process a single simple one off request
  */
-int RGWHTTPClient::process(optional_yield y)
+int RGWHTTPClient::process(const DoutPrefixProvider* dpp, optional_yield y)
 {
-  return RGWHTTP::process(this, y);
+  return RGWHTTP::process(dpp, this, y);
 }
 
 string RGWHTTPClient::to_str()
@@ -648,9 +648,9 @@ bool RGWHTTPClient::is_done()
 /*
  * wait for async request to complete
  */
-int RGWHTTPClient::wait(optional_yield y)
+int RGWHTTPClient::wait(const DoutPrefixProvider* dpp, optional_yield y)
 {
-  return req_data->wait(y);
+  return req_data->wait(dpp, y);
 }
 
 void RGWHTTPClient::cancel()
@@ -1214,7 +1214,7 @@ int RGWHTTP::send(RGWHTTPClient *req) {
   return 0;
 }
 
-int RGWHTTP::process(RGWHTTPClient *req, optional_yield y) {
+int RGWHTTP::process(const DoutPrefixProvider* dpp, RGWHTTPClient *req, optional_yield y) {
   if (!req) {
     return 0;
   }
@@ -1223,6 +1223,6 @@ int RGWHTTP::process(RGWHTTPClient *req, optional_yield y) {
     return r;
   }
 
-  return req->wait(y);
+  return req->wait(dpp, y);
 }
 
index ef1883903266eab972e3614a629b996c02fb8ac8..51833585c83e035fdf47c983308e0d6ded7b91ba 100644 (file)
@@ -151,9 +151,9 @@ public:
     req_timeout = timeout;
   }
 
-  int process(optional_yield y);
+  int process(const DoutPrefixProvider* dpp, optional_yield y);
 
-  int wait(optional_yield y);
+  int wait(const DoutPrefixProvider* dpp, optional_yield y);
   void cancel();
   bool is_done();
 
@@ -349,5 +349,6 @@ class RGWHTTP
 {
 public:
   static int send(RGWHTTPClient *req);
-  static int process(RGWHTTPClient *req, optional_yield y);
+  static int process(const DoutPrefixProvider* dpp, RGWHTTPClient *req,
+                     optional_yield y);
 };
index 2fa35d74f6f912f185a29cc4e1a601967ea8783e..8a0873a047cc173d8cfc3c6fac59be12303f6017 100644 (file)
@@ -212,7 +212,7 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp,
 
   token_req.set_url(token_url);
 
-  const int ret = token_req.process(y);
+  const int ret = token_req.process(dpp, y);
 
   /* Detect rejection earlier than during the token parsing step. */
   if (token_req.get_http_status() ==
@@ -290,7 +290,7 @@ int Service::get_keystone_barbican_token(const DoutPrefixProvider *dpp,
   token_req.set_url(token_url);
 
   ldpp_dout(dpp, 20) << "Requesting secret from barbican url=" << token_url << dendl;
-  const int ret = token_req.process(y);
+  const int ret = token_req.process(dpp, y);
   if (ret < 0) {
     ldpp_dout(dpp, 20) << "Barbican process error:" << token_bl.c_str() << dendl;
     return ret;
index d5854ccea927aac94c95be044b6a3f87c63cc518..f8c6992cf644ab88ff97ecaab0e96da57c152c45 100644 (file)
@@ -306,7 +306,7 @@ protected:
       secret_req.set_client_key(kctx.ssl_clientkey());
     }
 
-    res = secret_req.process(y);
+    res = secret_req.process(dpp, y);
 
     // map 401 to EACCES instead of EPERM
     if (secret_req.get_http_status() ==
@@ -782,8 +782,8 @@ private:
 protected:
        KmipGetTheKey(CephContext *cct) : cct(cct) {}
        KmipGetTheKey& keyid_to_keyname(std::string_view key_id);
-       KmipGetTheKey& get_uniqueid_for_keyname(optional_yield y);
-       int get_key_for_uniqueid(optional_yield y, std::string &);
+       KmipGetTheKey& get_uniqueid_for_keyname(const DoutPrefixProvider* dpp, optional_yield y);
+       int get_key_for_uniqueid(const DoutPrefixProvider* dpp, optional_yield y, std::string &);
        friend KmipSecretEngine;
 };
 
@@ -808,7 +808,8 @@ KmipGetTheKey::keyid_to_keyname(std::string_view key_id)
 }
 
 KmipGetTheKey&
-KmipGetTheKey::get_uniqueid_for_keyname(optional_yield y)
+KmipGetTheKey::get_uniqueid_for_keyname(const DoutPrefixProvider* dpp,
+                                        optional_yield y)
 {
        RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::LOCATE);
 
@@ -834,7 +835,8 @@ KmipGetTheKey::get_uniqueid_for_keyname(optional_yield y)
 }
 
 int
-KmipGetTheKey::get_key_for_uniqueid(optional_yield y, std::string& actual_key)
+KmipGetTheKey::get_key_for_uniqueid(const DoutPrefixProvider* dpp,
+                                    optional_yield y, std::string& actual_key)
 {
        if (failed) return ret;
        RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::GET);
@@ -866,8 +868,8 @@ public:
        int r;
        r = KmipGetTheKey{cct}
                .keyid_to_keyname(key_id)
-               .get_uniqueid_for_keyname(y)
-               .get_key_for_uniqueid(y, actual_key);
+               .get_uniqueid_for_keyname(dpp, y)
+               .get_key_for_uniqueid(dpp, y, actual_key);
        return r;
   }
 };
@@ -937,7 +939,7 @@ static int request_key_from_barbican(const DoutPrefixProvider *dpp,
   secret_req.append_header("Accept", "application/octet-stream");
   secret_req.append_header("X-Auth-Token", barbican_token);
 
-  res = secret_req.process(y);
+  res = secret_req.process(dpp, y);
   // map 401 to EACCES instead of EPERM
   if (secret_req.get_http_status() ==
       RGWHTTPTransceiver::HTTP_STATUS_UNAUTHORIZED) {
index 7422615aec9082882760b26a89ed34946f7fa59d..0bda4d62a51add8bd224a9b0a73727d9ea727931 100644 (file)
@@ -71,7 +71,7 @@ int rgw_opa_authorize(RGWOp *& op,
   req.set_send_length(ss.str().length());
 
   /* send request */
-  ret = req.process(null_yield);
+  ret = req.process(op, s->yield);
   if (ret < 0) {
     ldpp_dout(op, 2) << "OPA process error:" << bl.c_str() << dendl;
     return ret;
index 941856e6006d2837d97dbf305e19be9a593c6688..45b5e3076f494d77d0bbe76965db8124e9a8a8f5 100644 (file)
@@ -452,7 +452,7 @@ int RGWRESTSimpleRequest::forward_request(const DoutPrefixProvider *dpp, const R
   method = new_info.method;
   url = new_url;
 
-  int r = process(y);
+  int r = process(dpp, y);
   if (r < 0){
     if (r == -EINVAL){
       // curl_easy has errored, generally means the service is not available
@@ -922,14 +922,15 @@ int RGWRESTStreamRWRequest::send(RGWHTTPManager *mgr)
   return RGWHTTPStreamRWRequest::send(mgr);
 }
 
-int RGWHTTPStreamRWRequest::complete_request(optional_yield y,
+int RGWHTTPStreamRWRequest::complete_request(const DoutPrefixProvider* dpp,
+                                             optional_yield y,
                                              string *etag,
                                              real_time *mtime,
                                              uint64_t *psize,
                                              map<string, string> *pattrs,
                                              map<string, string> *pheaders)
 {
-  int ret = wait(y);
+  int ret = wait(dpp, y);
   if (ret < 0) {
     return ret;
   }
index 923f8cc17839b00d6065306dfed88f44098501cb..ffedcc17a94a39db0607274669a651e17d0db9be 100644 (file)
@@ -168,7 +168,7 @@ public:
 
   virtual int send(RGWHTTPManager *mgr);
 
-  int complete_request(optional_yield y,
+  int complete_request(const DoutPrefixProvider* dpp, optional_yield y,
                        std::string *etag = nullptr,
                        real_time *mtime = nullptr,
                        uint64_t *psize = nullptr,
index 39d171dfb52f8a0a9eea024f8fb48c8345d99e8d..770ccae299098e3d3c9c719c8ea492e3be82f2d3 100644 (file)
@@ -257,10 +257,11 @@ int RGWRESTConn::put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_own
   return 0;
 }
 
-int RGWRESTConn::complete_request(RGWRESTStreamS3PutObj *req, string& etag,
+int RGWRESTConn::complete_request(const DoutPrefixProvider* dpp,
+                                  RGWRESTStreamS3PutObj *req, string& etag,
                                   real_time *mtime, optional_yield y)
 {
-  int ret = req->complete_request(y, &etag, mtime);
+  int ret = req->complete_request(dpp, y, &etag, mtime);
   if (ret == -EIO) {
     ldout(cct, 5) << __func__ << ": complete_request() returned ret=" << ret << dendl;
     set_url_unconnectable(req->get_url_orig());
@@ -408,7 +409,8 @@ done_err:
   return r;
 }
 
-int RGWRESTConn::complete_request(RGWRESTStreamRWRequest *req,
+int RGWRESTConn::complete_request(const DoutPrefixProvider* dpp,
+                                  RGWRESTStreamRWRequest *req,
                                   string *etag,
                                   real_time *mtime,
                                   uint64_t *psize,
@@ -416,7 +418,7 @@ int RGWRESTConn::complete_request(RGWRESTStreamRWRequest *req,
                                   map<string, string> *pheaders,
                                   optional_yield y)
 {
-  int ret = req->complete_request(y, etag, mtime, psize, pattrs, pheaders);
+  int ret = req->complete_request(dpp, y, etag, mtime, psize, pattrs, pheaders);
   if (ret == -EIO) {
     ldout(cct, 5) << __func__ << ": complete_request() returned ret=" << ret << dendl;
     set_url_unconnectable(req->get_url_orig());
@@ -467,7 +469,7 @@ int RGWRESTConn::get_resource(const DoutPrefixProvider *dpp,
       return ret;
     }
 
-    ret = req.complete_request(y);
+    ret = req.complete_request(dpp, y);
     if (ret == -EIO) {
       set_url_unconnectable(url);
       if (tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
@@ -521,7 +523,7 @@ int RGWRESTConn::send_resource(const DoutPrefixProvider *dpp, const std::string&
       return ret;
     }
 
-    ret = req.complete_request(y);
+    ret = req.complete_request(dpp, y);
     if (ret == -EIO) {
       set_url_unconnectable(url);
       if (tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
@@ -580,7 +582,7 @@ int RGWRESTReadResource::read(const DoutPrefixProvider *dpp, optional_yield y)
     return ret;
   }
 
-  ret = req.complete_request(y);
+  ret = req.complete_request(dpp, y);
   if (ret == -EIO) {
     conn->set_url_unconnectable(req.get_url_orig());
     ldpp_dout(dpp, 20) << __func__ << ": complete_request() returned ret=" << ret << dendl;
@@ -647,7 +649,7 @@ int RGWRESTSendResource::send(const DoutPrefixProvider *dpp, bufferlist& outbl,
     return ret;
   }
 
-  ret = req.complete_request(y);
+  ret = req.complete_request(dpp, y);
   if (ret == -EIO) {
     conn->set_url_unconnectable(req.get_url_orig());
     ldpp_dout(dpp, 20) << __func__ << ": complete_request() returned ret=" << ret << dendl;
index b2d1affb640f822c8bcdf1c1d773b1fc2661f2f2..7abf86a3d3f0932abb6d6a5851c2a0cbf3f707e0 100644 (file)
@@ -140,7 +140,8 @@ public:
   int put_obj_send_init(const rgw_obj& obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req);
   int put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_owner& uid, const rgw_obj& obj,
                          std::map<std::string, bufferlist>& attrs, RGWRESTStreamS3PutObj **req);
-  int complete_request(RGWRESTStreamS3PutObj *req, std::string& etag,
+  int complete_request(const DoutPrefixProvider* dpp,
+                       RGWRESTStreamS3PutObj *req, std::string& etag,
                        ceph::real_time *mtime, optional_yield y);
 
   struct get_obj_params {
@@ -178,7 +179,8 @@ public:
               bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest,
               bool skip_decrypt, rgw_zone_set_entry *dst_zone_trace, bool sync_cloudtiered,
               bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req);
-  int complete_request(RGWRESTStreamRWRequest *req,
+  int complete_request(const DoutPrefixProvider* dpp,
+                       RGWRESTStreamRWRequest *req,
                        std::string *etag,
                        ceph::real_time *mtime,
                        uint64_t *psize,
@@ -344,8 +346,8 @@ public:
     return req.get_http_status();
   }
 
-  int wait(bufferlist *pbl, optional_yield y) {
-    int ret = req.wait(y);
+  int wait(const DoutPrefixProvider* dpp, bufferlist *pbl, optional_yield y) {
+    int ret = req.wait(dpp, y);
     if (ret < 0) {
       if (ret == -EIO) {
         conn->set_url_unconnectable(req.get_url_orig());
@@ -361,7 +363,7 @@ public:
   }
 
   template <class T>
-  int wait(T *dest, optional_yield y);
+  int wait(const DoutPrefixProvider* dpp, T *dest, optional_yield y);
 
   template <class T>
   int fetch(const DoutPrefixProvider *dpp, T *dest, optional_yield y);
@@ -398,9 +400,10 @@ int RGWRESTReadResource::fetch(const DoutPrefixProvider *dpp, T *dest, optional_
 }
 
 template <class T>
-int RGWRESTReadResource::wait(T *dest, optional_yield y)
+int RGWRESTReadResource::wait(const DoutPrefixProvider* dpp, T *dest,
+                              optional_yield y)
 {
-  int ret = req.wait(y);
+  int ret = req.wait(dpp, y);
   if (ret < 0) {
     if (ret == -EIO) {
       conn->set_url_unconnectable(req.get_url_orig());
@@ -472,8 +475,9 @@ public:
   }
 
   template <class E = int>
-  int wait(bufferlist *pbl, optional_yield y, E *err_result = nullptr) {
-    int ret = req.wait(y);
+  int wait(const DoutPrefixProvider* dpp, bufferlist *pbl,
+           optional_yield y, E *err_result = nullptr) {
+    int ret = req.wait(dpp, y);
     *pbl = bl;
 
     if (ret == -EIO) {
@@ -488,13 +492,15 @@ public:
   }
 
   template <class T, class E = int>
-  int wait(T *dest, optional_yield y, E *err_result = nullptr);
+  int wait(const DoutPrefixProvider* dpp, T *dest,
+           optional_yield y, E *err_result = nullptr);
 };
 
 template <class T, class E>
-int RGWRESTSendResource::wait(T *dest, optional_yield y, E *err_result)
+int RGWRESTSendResource::wait(const DoutPrefixProvider* dpp, T *dest,
+                              optional_yield y, E *err_result)
 {
-  int ret = req.wait(y);
+  int ret = req.wait(dpp, y);
   if (ret == -EIO) {
     conn->set_url_unconnectable(req.get_url_orig());
   }
index b9c23aa159c2665e3066cf74d5270fd501bbf6b3..6df53f612cde91743f992eae241fd7226fda11b5 100644 (file)
@@ -315,7 +315,7 @@ WebTokenEngine::get_cert_url(const string& iss, const DoutPrefixProvider *dpp, o
   //Headers
   openidc_req.append_header("Content-Type", "application/x-www-form-urlencoded");
 
-  int res = openidc_req.process(y);
+  int res = openidc_req.process(dpp, y);
   if (res < 0) {
     ldpp_dout(dpp, 10) << "HTTP request res: " << res << dendl;
     throw -EINVAL;
@@ -353,7 +353,7 @@ WebTokenEngine::validate_signature(const DoutPrefixProvider* dpp, const jwt::dec
     //Headers
     cert_req.append_header("Content-Type", "application/x-www-form-urlencoded");
 
-    int res = cert_req.process(y);
+    int res = cert_req.process(dpp, y);
     if (res < 0) {
       ldpp_dout(dpp, 10) << "HTTP request res: " << res << dendl;
       throw -EINVAL;
index af60a0e275d224d0bddf6af98260962b41c3b6bb..032b3734bf93e8488c48f6272a273a0a35f54646 100644 (file)
@@ -479,7 +479,7 @@ ExternalTokenEngine::authenticate(const DoutPrefixProvider* dpp,
 
   ldpp_dout(dpp, 10) << "rgw_swift_validate_token url=" << url_buf << dendl;
 
-  int ret = validator.process(y);
+  int ret = validator.process(dpp, y);
   if (ret < 0) {
     throw ret;
   }
index f2daeddca79297994bd21a5fa1119ad3ab515e2b..400ac32f411622f5b3af9f592aeb16b0c8576714 100644 (file)
@@ -76,7 +76,8 @@ TEST(HTTPManager, ReadTruncated)
   const auto url = std::string{"http://127.0.0.1:"} + std::to_string(acceptor.local_endpoint().port());
 
   RGWHTTPClient client{g_ceph_context, "GET", url};
-  EXPECT_EQ(-EAGAIN, RGWHTTP::process(&client, null_yield));
+  const auto dpp = NoDoutPrefix{g_ceph_context, ceph_subsys_rgw};
+  EXPECT_EQ(-EAGAIN, RGWHTTP::process(&dpp, &client, null_yield));
 
   server.join();
 }
@@ -100,7 +101,8 @@ TEST(HTTPManager, Head)
   const auto url = std::string{"http://127.0.0.1:"} + std::to_string(acceptor.local_endpoint().port());
 
   RGWHTTPClient client{g_ceph_context, "HEAD", url};
-  EXPECT_EQ(0, RGWHTTP::process(&client, null_yield));
+  const auto dpp = NoDoutPrefix{g_ceph_context, ceph_subsys_rgw};
+  EXPECT_EQ(0, RGWHTTP::process(&dpp, &client, null_yield));
 
   server.join();
 }