From: Oguzhan Ozmen Date: Fri, 21 Nov 2025 21:18:05 +0000 (+0000) Subject: RGW: prevent RGWAsyncRadosProcessor from queuing requests during shutdown X-Git-Tag: v21.0.0~382^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e777558c2123cbf491ce8e0c100de1402247bef4;p=ceph.git RGW: prevent RGWAsyncRadosProcessor from queuing requests during shutdown Add a guard in RGWAsyncRadosProcessor::queue() to avoid queuing new requests once the processor is shutting down. When the going_down flag is set, any incoming request is immediately completed with -ECANCELED. Also introduce RGWAsyncRadosRequest::complete_immediate() to safely signal completion for requests that are skipped during shutdown. Fixes: https://tracker.ceph.com/issues/66100 Signed-off-by: Oguzhan Ozmen --- diff --git a/src/rgw/driver/rados/rgw_cr_rados.cc b/src/rgw/driver/rados/rgw_cr_rados.cc index 32f36f58db2c..fe44103a649d 100644 --- a/src/rgw/driver/rados/rgw_cr_rados.cc +++ b/src/rgw/driver/rados/rgw_cr_rados.cc @@ -103,6 +103,10 @@ void RGWAsyncRadosProcessor::handle_request(const DoutPrefixProvider *dpp, RGWAs } void RGWAsyncRadosProcessor::queue(RGWAsyncRadosRequest *req) { + if (is_going_down()) { + req->complete_immediate(-ECANCELED); + return; + } req_throttle.get(1); req_wq.queue(req); } diff --git a/src/rgw/driver/rados/rgw_cr_rados.h b/src/rgw/driver/rados/rgw_cr_rados.h index 95c559b12306..df40db5dbc46 100644 --- a/src/rgw/driver/rados/rgw_cr_rados.h +++ b/src/rgw/driver/rados/rgw_cr_rados.h @@ -55,6 +55,20 @@ public: put(); } + // Complete immediately with a specific rc without sending any request. + void complete_immediate(int rc) { + get(); + retcode = rc; + { + std::lock_guard l{lock}; + if (notifier) { + notifier->cb(); // drops its own ref + notifier = nullptr; + } + } + put(); + } + int get_ret_status() { return retcode; } void finish() {