]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: stop realm reloader before store shutdown 36192/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 10 Jun 2020 14:53:55 +0000 (10:53 -0400)
committerNathan Cutler <ncutler@suse.com>
Sat, 18 Jul 2020 20:39:12 +0000 (22:39 +0200)
otherwise the two could race to destroy the store

Fixes: https://tracker.ceph.com/issues/45969
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7787dfb4926dcc2baa7530b620ae8cfccf90bc30)

Conflicts:
src/rgw/rgw_main.cc
- RGWRealmWatcher realm_watcher(...) line looks different in nautilus

src/rgw/rgw_main.cc

index 15174b1b9da63052913cf3a3886f44ee2ae8d704..44609741ed742c33c7c0ac68a13aeef88f535fae 100644 (file)
@@ -565,10 +565,11 @@ int 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<RGWRealmReloader> 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)
@@ -581,6 +582,8 @@ int main(int argc, const char **argv)
 
   derr << "shutting down" << dendl;
 
+  reloader.reset(); // stop the realm reloader
+
   for (list<RGWFrontend *>::iterator liter = fes.begin(); liter != fes.end();
        ++liter) {
     RGWFrontend *fe = *liter;