RGWServices_Def::RGWServices_Def() = default;
-RGWServices_Def::~RGWServices_Def() = default;
+RGWServices_Def::~RGWServices_Def()
+{
+ shutdown();
+}
int RGWServices_Def::init(CephContext *cct,
bool have_cache)
return 0;
}
+void RGWServices_Def::shutdown()
+{
+ if (has_shutdown) {
+ return;
+ }
+
+ sysobj->shutdown();
+ sysobj_core->shutdown();
+ notify->shutdown();
+ if (sysobj_cache) {
+ sysobj_cache->shutdown();
+ }
+ quota->shutdown();
+ zone_utils->shutdown();
+ zone->shutdown();
+ rados->shutdown();
+
+ has_shutdown = true;
+
+}
+
int RGWServices::init(CephContext *cct, bool have_cache)
{
#include "rgw/rgw_common.h"
-struct RGWServices_Shared;
+struct RGWServices_Def;
class RGWServiceInstance
{
- friend struct RGWServices_Shared;
+ friend struct RGWServices_Def;
protected:
CephContext *cct;
struct RGWServices_Def
{
+ bool has_shutdown{false};
+
std::unique_ptr<RGWSI_Finisher> finisher;
std::unique_ptr<RGWSI_Notify> notify;
std::unique_ptr<RGWSI_RADOS> rados;
~RGWServices_Def();
int init(CephContext *cct, bool have_cache);
+ void shutdown();
};
RGWSI_SysObj_Core *core{nullptr};
int init(CephContext *cct, bool have_cache);
+ void shutdown() {
+ _svc.shutdown();
+ }
};