From 84764013e49b3c70bf6f8a5a7090a829e28db76d Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 8 Nov 2018 12:56:26 -0800 Subject: [PATCH] rgw: shutdown services only if initialized Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_service.cc | 5 +++++ src/rgw/rgw_service.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/rgw/rgw_service.cc b/src/rgw/rgw_service.cc index ea5d6520e45..83aa4f39320 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 16ded3255ac..a9558df74ac 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; -- 2.39.5