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 <oozmen@bloomberg.net>
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) {