From: Adarsh Date: Wed, 26 Feb 2025 19:12:23 +0000 (+0000) Subject: rgw: ensure connect timeout is set to 3 seconds only in the case of notifications X-Git-Tag: v20.3.0~446^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a4be8108998ff855947f9bb2c36c563bbf2407b;p=ceph.git rgw: ensure connect timeout is set to 3 seconds only in the case of notifications Signed-off-by: Adarsh --- diff --git a/src/rgw/driver/rados/rgw_pubsub_push.cc b/src/rgw/driver/rados/rgw_pubsub_push.cc index 3041e3a932c..f3baeeb0aa8 100644 --- a/src/rgw/driver/rados/rgw_pubsub_push.cc +++ b/src/rgw/driver/rados/rgw_pubsub_push.cc @@ -101,6 +101,8 @@ public: } bufferlist read_bl; RGWPostHTTPData request(cct, "POST", endpoint, &read_bl, verify_ssl); + //default to 3 seconds for wrong url hits - if wrong endpoint configured + request.set_req_connect_timeout(3); const auto post_data = json_format_pubsub_event(event); if (cloudevents) { // following: https://github.com/cloudevents/spec/blob/v1.0.1/http-protocol-binding.md diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h index 01762cf7ea5..9db6007581a 100644 --- a/src/rgw/rgw_http_client.h +++ b/src/rgw/rgw_http_client.h @@ -64,7 +64,7 @@ protected: param_vec_t headers; long req_timeout{0L}; - long req_connect_timeout{3L}; + long req_connect_timeout{0L}; void init();