From: Casey Bodley Date: Wed, 10 Jun 2020 14:53:55 +0000 (-0400) Subject: rgw: stop realm reloader before store shutdown X-Git-Tag: v15.2.5~6^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=884ca48cbe967f7b2b652ce079de2e285e197c28;p=ceph.git rgw: stop realm reloader before store shutdown otherwise the two could race to destroy the store Fixes: https://tracker.ceph.com/issues/45969 Signed-off-by: Casey Bodley (cherry picked from commit 7787dfb4926dcc2baa7530b620ae8cfccf90bc30) --- diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index e50b5a7161a6..5d189b8b7ac0 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -600,10 +600,11 @@ int radosgw_Main(int argc, const char **argv) // add a watcher to respond to realm configuration changes RGWPeriodPusher pusher(store); RGWFrontendPauser pauser(fes, implicit_tenant_context, &pusher); - RGWRealmReloader reloader(store, service_map_meta, &pauser); + std::optional reloader(std::in_place, store, + service_map_meta, &pauser); RGWRealmWatcher realm_watcher(g_ceph_context, store->svc()->zone->get_realm()); - realm_watcher.add_watcher(RGWRealmNotify::Reload, reloader); + realm_watcher.add_watcher(RGWRealmNotify::Reload, *reloader); realm_watcher.add_watcher(RGWRealmNotify::ZonesNeedPeriod, pusher); #if defined(HAVE_SYS_PRCTL_H) @@ -616,6 +617,8 @@ int radosgw_Main(int argc, const char **argv) derr << "shutting down" << dendl; + reloader.reset(); // stop the realm reloader + for (list::iterator liter = fes.begin(); liter != fes.end(); ++liter) { RGWFrontend *fe = *liter;