rgw: shutdown services only if initialized

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2018-11-08 12:56:26 -08:00
parent e0dc5a86cb
commit 84764013e4
2 changed files with 6 additions and 0 deletions

View 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;
}

View 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;