int RGWRemoteDataLog::init(const string& _source_zone, RGWRESTConn *_conn)
{
+ if (initialized) {
+ return 0;
+ }
+
CephContext *cct = store->ctx();
async_rados = new RGWAsyncRadosProcessor(store, cct->_conf->rgw_num_async_rados_threads);
async_rados->start();
int ret = http_manager.set_threaded();
if (ret < 0) {
+ async_rados->stop();
+ delete async_rados;
+ async_rados = NULL;
ldout(store->ctx(), 0) << "failed in http_manager.set_threaded() ret=" << ret << dendl;
return ret;
}
+ initialized = true;
+
return 0;
}
RWLock lock;
RGWDataSyncCR *data_sync_cr;
+ bool initialized;
+
public:
RGWRemoteDataLog(RGWRados *_store, RGWDataSyncStatusManager *_sm) : RGWCoroutinesManager(_store->ctx()), store(_store),
conn(NULL),
http_manager(store->ctx(), &completion_mgr),
- status_manager(_sm), lock("RGWRemoteDataLog::lock"), data_sync_cr(NULL) {}
+ status_manager(_sm), lock("RGWRemoteDataLog::lock"), data_sync_cr(NULL),
+ initialized(false) {}
int init(const string& _source_zone, RGWRESTConn *_conn);
void finish();
return 0; /* no interval associated, it'll run once until stopped */
} else {
#define DATA_SYNC_INIT_WAIT_SEC 20
- return DATA_SYNC_INIT_WAIT_SEC;
+ return DATA_SYNC_INIT_WAIT_SEC * 1000;
}
}
void stop_process() {