Commit 2427bd88 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed usage of pointer to watchdog in situations where it is not set (unit...

Fixed usage of pointer to watchdog in situations where it is not set (unit tests). The scheme already existed but was not used everywhere.
parent b4fa242f
......@@ -364,8 +364,10 @@ void MigrationReportPacker::WorkerThread::run(){
//we end up in the catch below
m_parent.m_client.reportEndOfSessionWithError(e.getMessageValue(),SEINTERNAL,chrono);
m_parent.logRequestReport(chrono,"Successfully closed client's session after the failed report MigrationResult");
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
break;
}
}
......@@ -374,8 +376,10 @@ void MigrationReportPacker::WorkerThread::run(){
//we get there because to tried to close the connection and it failed
//either from the catch a few lines above or directly from rep->execute
m_parent.logRequestReport(chrono,"tried to report endOfSession(WithError) and got an exception, cant do much more",LOG_ERR);
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
}
}
......
......@@ -269,8 +269,10 @@ void RecallReportPacker::WorkerThread::run(){
//reportEndOfSessionWithError might throw
m_parent.m_client.reportEndOfSessionWithError(e.getMessageValue(),SEINTERNAL,chrono);
m_parent.logRequestReport(chrono,"Successfully closed client's session after the failed report RecallResult");
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
// We need to wait until the end of session is signaled from upsteam
while (!isItTheEnd) {
std::auto_ptr<Report> r(m_parent.m_fifo.pop());
......@@ -296,8 +298,10 @@ void RecallReportPacker::WorkerThread::run(){
//we get there because to tried to close the connection and it failed
//either from the catch a few lines above or directly from rep->execute
m_parent.logRequestReport(chrono,"tried to report endOfSession(WithError) and got an exception, cant do much more",LOG_ERR);
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
}
m_parent.m_lc.log(LOG_DEBUG, "Finishing RecallReportPacker thread");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment