From: Oguzhan Ozmen Date: Fri, 21 Nov 2025 21:13:34 +0000 (+0000) Subject: RGW: set down_flag early on sync processor threads during shutdown X-Git-Tag: v21.0.0~382^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53015492b53b7b5277bf18d3e4b41f4fe42b4e4d;p=ceph.git RGW: set down_flag early on sync processor threads during shutdown Set down_flag on all sync-related threads (meta sync, data sync, and log trimmer) before draining or joining them in RGWRados::finalize(). This early flagging ensures that any in-progress data sync operations can detect shutdown sooner and stop issuing new async processor requests, reducing the chance of deadlock during realm reload. Fixes: https://tracker.ceph.com/issues/66100 Signed-off-by: Oguzhan Ozmen --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 8a24c38f6691..2774321c95b3 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -1067,6 +1067,19 @@ bool RGWIndexCompletionManager::handle_completion(completion_t cb, complete_op_d void RGWRados::finalize() { + if (run_sync_thread) { + std::lock_guard l{meta_sync_thread_lock}; + meta_sync_processor_thread->set_down_flag(); + std::lock_guard dl{data_sync_thread_lock}; + for (auto iter : data_sync_processor_threads) { + RGWDataSyncProcessorThread *thread = iter.second; + thread->set_down_flag(); + } + if (sync_log_trimmer) { + sync_log_trimmer->set_down_flag(); + } + } + /* Before joining any sync threads, drain outstanding requests & * mark the async_processor as going_down() */ if (svc.async_processor) {