From: Michal Voců Date: Thu, 20 Jan 2011 16:49:00 +0000 (+0000) Subject: msg broker reconnect fixes X-Git-Tag: merge_21_head_round3_dst~28 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=dd4899e2bac7d7fc6b2486b9c89a1bdde7ea7cea;p=jra1mw.git msg broker reconnect fixes --- diff --git a/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp b/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp index 67fd77e..7e788c7 100644 --- a/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp +++ b/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp @@ -97,6 +97,7 @@ OutputPlugin::connect(const std::string &topic) current_connection->start(); releaseConnection(); } catch (cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "OutputPlugin::connect exception: %s", e.what()); releaseConnection(); cleanup(); throw e; @@ -222,11 +223,23 @@ OutputPlugin::close() void OutputPlugin::cleanup() { - close(); + try { + close(); + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: close exception: %s", e.what()); + } pthread_rwlock_wrlock(&connection_lock); if(connection && current_connection == connection) { - connection->close(); - delete connection; + try { + connection->close(); + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: connection close exception: %s", e.what()); + } + try { + delete connection; + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: cleanup exception: %s", e.what()); + } connection = NULL; current_connection = NULL; }