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>
}
void RGWAsyncRadosProcessor::queue(RGWAsyncRadosRequest *req) {
+ if (is_going_down()) {
+ req->complete_immediate(-ECANCELED);
+ return;
+ }
req_throttle.get(1);
req_wq.queue(req);
}
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() {