]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW: prevent RGWAsyncRadosProcessor from queuing requests during shutdown
authorOguzhan Ozmen <oozmen@bloomberg.net>
Fri, 21 Nov 2025 21:18:05 +0000 (21:18 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 26 Nov 2025 03:38:11 +0000 (03:38 +0000)
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 <oozmen@bloomberg.net>
src/rgw/driver/rados/rgw_cr_rados.cc
src/rgw/driver/rados/rgw_cr_rados.h

index 32f36f58db2c4992b513e26aff86c9e1f827038e..fe44103a649dc4f7897b00da0f2ad3f088ff86c8 100644 (file)
@@ -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);
 }
index 95c559b12306cd18188ebd74aa045630a7f9cdd4..df40db5dbc46ac2d6269fc1aed6fd59490a4ed7f 100644 (file)
@@ -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() {