]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: shutdown services only if initialized
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 8 Nov 2018 20:56:26 +0000 (12:56 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 8 Nov 2018 20:56:26 +0000 (12:56 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_service.cc
src/rgw/rgw_service.h

index ea5d6520e4593b56cf877d5b2d91d43439f26dfb..83aa4f39320715494b238a9a83554f07d37002ab 100644 (file)
@@ -54,6 +54,7 @@ int RGWServices_Def::init(CephContext *cct,
     sysobj->init(rados.get(), sysobj_core.get());
   }
 
+  can_shutdown = true;
 
   int r = finisher->start();
   if (r < 0) {
@@ -122,6 +123,10 @@ int RGWServices_Def::init(CephContext *cct,
 
 void RGWServices_Def::shutdown()
 {
+  if (!can_shutdown) {
+    return;
+  }
+
   if (has_shutdown) {
     return;
   }
index 16ded3255ac65dd694277eb1e2164768f051b29b..a9558df74ac4e1379a962e62d9a7323b0865c7b4 100644 (file)
@@ -54,6 +54,7 @@ class RGWSI_SysObj_Cache;
 
 struct RGWServices_Def
 {
+  bool can_shutdown{false};
   bool has_shutdown{false};
 
   std::unique_ptr<RGWSI_Finisher> finisher;