diff options
author | Yehuda Sadeh <yehuda@redhat.com> | 2018-11-08 21:56:26 +0100 |
---|---|---|
committer | Yehuda Sadeh <yehuda@redhat.com> | 2018-11-08 21:56:26 +0100 |
commit | 84764013e49b3c70bf6f8a5a7090a829e28db76d (patch) | |
tree | 5dc7e72877e82b6edd654e49e6dbcb0177174ba2 | |
parent | librados_test_stub: implement move operations (diff) | |
download | ceph-84764013e49b3c70bf6f8a5a7090a829e28db76d.tar.xz ceph-84764013e49b3c70bf6f8a5a7090a829e28db76d.zip |
rgw: shutdown services only if initialized
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
-rw-r--r-- | src/rgw/rgw_service.cc | 5 | ||||
-rw-r--r-- | src/rgw/rgw_service.h | 1 |
2 files changed, 6 insertions, 0 deletions
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<RGWSI_Finisher> finisher; |