From: Yehuda Sadeh Date: Thu, 8 Nov 2018 20:56:26 +0000 (-0800) Subject: rgw: shutdown services only if initialized X-Git-Tag: v14.1.0~965^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24014%2Fhead;p=ceph.git rgw: shutdown services only if initialized Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_service.cc b/src/rgw/rgw_service.cc index ea5d6520e459..83aa4f393207 100644 --- a/src/rgw/rgw_service.cc +++ b/src/rgw/rgw_service.cc @@ -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; } diff --git a/src/rgw/rgw_service.h b/src/rgw/rgw_service.h index 16ded3255ac6..a9558df74ac4 100644 --- a/src/rgw/rgw_service.h +++ b/src/rgw/rgw_service.h @@ -54,6 +54,7 @@ class RGWSI_SysObj_Cache; struct RGWServices_Def { + bool can_shutdown{false}; bool has_shutdown{false}; std::unique_ptr finisher;