Drain outstanding requests from the async_processor before stopping
the sync threads to avoid any use-after-free of their local variables.
Fixes: https://tracker.ceph.com/issues/49666
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit
9b451763ff583f25c821aecf3446884c0fb95273)
void RGWRados::finalize()
{
+ /* Before joining any sync threads, drain outstanding requests &
+ * mark the async_processor as going_down() */
+ if (svc.rados) {
+ svc.rados->stop_processor();
+ }
+
if (run_sync_thread) {
std::lock_guard l{meta_sync_thread_lock};
meta_sync_processor_thread->stop();
}
}
+void RGWSI_RADOS::stop_processor()
+{
+ if (async_processor) {
+ async_processor->stop();
+ }
+}
+
librados::Rados* RGWSI_RADOS::get_rados_handle()
{
return &rados;
void init() {}
void shutdown() override;
+ void stop_processor();
std::string cluster_fsid();
uint64_t instance_id();