From 3b7b7dae9b76a0666d47302f031a305604eeddc4 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 7 Oct 2025 12:07:13 -0400 Subject: [PATCH] rgw/services: don't allocate RGWSI_Notify unless its used 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 --- src/rgw/driver/rados/rgw_service.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/rgw/driver/rados/rgw_service.cc b/src/rgw/driver/rados/rgw_service.cc index dbd86426c8ef6..ec6d4aea052dd 100644 --- a/src/rgw/driver/rados/rgw_service.cc +++ b/src/rgw/driver/rados/rgw_service.cc @@ -64,7 +64,9 @@ int RGWServices_Def::init(CephContext *cct, config_key_rados = std::make_unique(cct); datalog_rados = std::make_unique(driver); mdlog = std::make_unique(cct, run_sync, cfgstore); - notify = std::make_unique(cct); + if (have_cache) { + notify = std::make_unique(cct); + } zone = std::make_unique(cct, cfgstore, site); zone_utils = std::make_unique(cct); quota = std::make_unique(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(); } -- 2.39.5