]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/rados: fix init/shutdown order for RGWIndexCompletionManager wip-74067
authorCasey Bodley <cbodley@redhat.com>
Tue, 2 Dec 2025 21:19:05 +0000 (16:19 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 2 Dec 2025 21:30:55 +0000 (16:30 -0500)
RGWRados::init_complete() initializes this RGWIndexCompletionManager
after starting some background threads that depend on it, like RGWLC and
RGWDataSyncProcessorThread and RGWObjectExpirer. this can lead to a
crash when accessing a null index_completion_manager

RGWRados::finalize() deletes it before stopping the Restore thread

Fixes: https://tracker.ceph.com/issues/74067
Reported-by: J. Eric Ivancich <ivancich@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index baf15ba009c5de73971f36da3b2e495fd612e4b8..7da31a87a723b3ac6259e6f896f564f5198a383f 100644 (file)
@@ -1143,7 +1143,6 @@ void RGWRados::finalize()
     reshard->stop_processor();
   }
   delete reshard;
-  delete index_completion_manager;
 
   if (run_notification_thread) {
     rgw::notify::shutdown();
@@ -1158,6 +1157,7 @@ void RGWRados::finalize()
     restore->stop_processor();
   }
   restore = NULL;
+  delete index_completion_manager;
 }
 
 /** 
@@ -1287,6 +1287,8 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y, rgw
 
   pools_initialized = true;
 
+  index_completion_manager = new RGWIndexCompletionManager(this);
+
   if (use_gc) {
     gc = new RGWGC();
     gc->initialize(cct, this, y);
@@ -1435,8 +1437,6 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y, rgw
     reshard->start_processor();
   }
 
-  index_completion_manager = new RGWIndexCompletionManager(this);
-
   if (run_bucket_logging_thread) {
     if (!rgw::bucketlogging::init(dpp, this->driver, *svc.site)) {
       ldpp_dout(dpp, 0) << "ERROR: failed to initialize bucket logging manager" << dendl;