diff --git a/chaos/common/io/IODirectIOPSMsgDriver.cpp b/chaos/common/io/IODirectIOPSMsgDriver.cpp index a99ae04cabfd21070985fba56882359cb8343f91..22ab0a1b30909445ea0d71a7d9319da85bf62d45 100644 --- a/chaos/common/io/IODirectIOPSMsgDriver.cpp +++ b/chaos/common/io/IODirectIOPSMsgDriver.cpp @@ -135,12 +135,14 @@ int IODirectIOPSMsgDriver::addHandler(chaos::common::message::msgHandler cb) { void IODirectIOPSMsgDriver::deinit() { IODirectIODriver::deinit(); + /* if(prod.get()){ prod->stop(); } if (cons.get()) { cons->stop(); } + */ IODirectIOPSMsgDriver_DLDBG_ << "Deinitialized"; } diff --git a/chaos/common/rpc/psm/PSMClient.cpp b/chaos/common/rpc/psm/PSMClient.cpp index 943feca944d5eec6354a264c784bead9328fac9a..5a6f2cc6fa390920b7ac34aae1f9da6cfc78a93d 100644 --- a/chaos/common/rpc/psm/PSMClient.cpp +++ b/chaos/common/rpc/psm/PSMClient.cpp @@ -57,6 +57,7 @@ PSMClient::~PSMClient(){ // #ifndef CHAOS_PROMETHEUS // delete counter_zmqerror_uptr; // #endif +deinit(); } /* @@ -118,7 +119,7 @@ void PSMClient::stop() { void PSMClient::deinit() { PSMC_LAPP << "PSM Destroyed"; - + stop(); } /* diff --git a/chaos/common/rpc/psm/PSMServer.cpp b/chaos/common/rpc/psm/PSMServer.cpp index cdec9e44b3383da8be2e997e1c8470555f52ba93..600548430adc4fb8bdb953c27c1eb01a57dbabdc 100644 --- a/chaos/common/rpc/psm/PSMServer.cpp +++ b/chaos/common/rpc/psm/PSMServer.cpp @@ -45,7 +45,7 @@ RpcServer(alias){ } PSMServer::~PSMServer() { - + deinit(); } //init the server getting the configuration value @@ -123,7 +123,7 @@ void PSMServer::messageHandler( chaos::common::message::ele_t& data) { PSMS_LDBG << data.cd->getInt32Value(RpcActionDefinitionKey::CS_CMDM_MESSAGE_ID)<<" - Message Received from node:"<<src<<" seq_id:"<<seq_id ;//<< " desc:"<<data.cd->getJSONString(); } else { - PSMS_LDBG << "Message Received from node:"<<src<<" seq_id:"<<seq_id<<" sent:"<<(now-ts)<<" ms";//<< " desc:"<<data.cd->getJSONString(); + PSMS_LDBG << "Message Received from node:\""<<src<<"\" seq_id:"<<seq_id<<" sent:"<<(now-ts)<<" ms";//<< " desc:"<<data.cd->getJSONString(); } @@ -163,12 +163,12 @@ void PSMServer::messageError( chaos::common::message::ele_t& data) { //start the rpc adapter void PSMServer::start() { if(cfg->hasKey("ismds")){ - PSMS_LAPP << "Subscribing to " <<chaos::common::constants::CHAOS_ADMIN_ADMIN_TOPIC; + PSMS_LDBG << "Subscribing to " <<chaos::common::constants::CHAOS_ADMIN_ADMIN_TOPIC; cons->subscribe(chaos::common::constants::CHAOS_ADMIN_ADMIN_TOPIC); cons->addHandler(chaos::common::constants::CHAOS_ADMIN_ADMIN_TOPIC, boost::bind(&PSMServer::messageHandler, this, _1)); } - PSMS_LAPP << "Subscribing to " << nodeuid + chaos::DataPackPrefixID::COMMAND_DATASET_POSTFIX; + PSMS_LDBG << "Subscribing to " << nodeuid + chaos::DataPackPrefixID::COMMAND_DATASET_POSTFIX; cons->subscribe(nodeuid + chaos::DataPackPrefixID::COMMAND_DATASET_POSTFIX); cons->start(); prod->start(); @@ -176,6 +176,8 @@ void PSMServer::start() { //start the rpc adapter void PSMServer::stop() { + PSMS_LDBG << "STOP consumer and producer " << nodeuid + chaos::DataPackPrefixID::COMMAND_DATASET_POSTFIX; + cons->stop(); prod->stop(); @@ -183,6 +185,7 @@ void PSMServer::stop() { //deinit the rpc adapter void PSMServer::deinit() { - - PSMS_LAPP << "PSMServer deinit"; + PSMS_LDBG << "PSMServer deinit"; + stop(); + }