]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/services: don't allocate RGWSI_Notify unless its used
authorCasey Bodley <cbodley@redhat.com>
Tue, 7 Oct 2025 16:07:13 +0000 (12:07 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 9 Oct 2025 15:00:47 +0000 (11:00 -0400)
avoid allocating, initializing, and shutting down RGWSI_Notify if we
aren't going to start or use it

calling RGWSI_Notify::shutdown() without first calling
RGWSI_Notify::do_start() aborts in Finisher::stop() with:
> ceph_abort_msg("join on thread that was never started")

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_service.cc

index dbd86426c8ef6dc387e31bca4971df686cea018e..ec6d4aea052dd8edc2aa0ff444b132f92e7173c0 100644 (file)
@@ -64,7 +64,9 @@ int RGWServices_Def::init(CephContext *cct,
   config_key_rados = std::make_unique<RGWSI_ConfigKey_RADOS>(cct);
   datalog_rados = std::make_unique<RGWDataChangesLog>(driver);
   mdlog = std::make_unique<RGWSI_MDLog>(cct, run_sync, cfgstore);
-  notify = std::make_unique<RGWSI_Notify>(cct);
+  if (have_cache) {
+    notify = std::make_unique<RGWSI_Notify>(cct);
+  }
   zone = std::make_unique<RGWSI_Zone>(cct, cfgstore, site);
   zone_utils = std::make_unique<RGWSI_ZoneUtils>(cct);
   quota = std::make_unique<RGWSI_Quota>(cct);
@@ -94,7 +96,9 @@ int RGWServices_Def::init(CephContext *cct,
   config_key_rados->init(driver->getRados()->get_rados_handle());
   mdlog->init(driver->getRados()->get_rados_handle(), zone.get(), sysobj.get(),
              cls.get(), async_processor.get());
-  notify->init(zone.get(), driver->getRados()->get_rados_handle());
+  if (notify) {
+    notify->init(zone.get(), driver->getRados()->get_rados_handle());
+  }
   zone->init(sysobj.get(), driver->getRados()->get_rados_handle(),
             sync_modules.get(), bucket_sync_sobj.get());
   zone_utils->init(driver->getRados()->get_rados_handle(), zone.get());
@@ -113,13 +117,16 @@ int RGWServices_Def::init(CephContext *cct,
   can_shutdown = true;
 
   int r = 0;
-  if (!raw) {
+
+  if (notify) {
     r = notify->start(y, dpp);
     if (r < 0) {
       ldpp_dout(dpp, 0) << "ERROR: failed to start notify service (" << cpp_strerror(-r) << dendl;
       return r;
     }
+  }
 
+  if (!raw) {
     r = zone->start(y, dpp);
     if (r < 0) {
       ldpp_dout(dpp, 0) << "ERROR: failed to start zone service (" << cpp_strerror(-r) << dendl;
@@ -229,7 +236,9 @@ void RGWServices_Def::shutdown()
   datalog_rados.reset();
   user_rados->shutdown();
   sync_modules->shutdown();
-  notify->shutdown();
+  if (notify) {
+    notify->shutdown();
+  }
   mdlog->shutdown();
   config_key_rados->shutdown();
   cls->shutdown();
@@ -240,7 +249,6 @@ void RGWServices_Def::shutdown()
 
   sysobj->shutdown();
   sysobj_core->shutdown();
-  notify->shutdown();
   if (sysobj_cache) {
     sysobj_cache->shutdown();
   }