Commit 811e26ff authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Fixed memory corruption bug (uncaught exception: CTA vs CASTOR exceptions...)

parent 06257c1d
......@@ -64,12 +64,12 @@ void cta::ArchiveJob::complete() {
// failed
//------------------------------------------------------------------------------
void cta::ArchiveJob::failed(const cta::exception::Exception &ex) {
//throw std::runtime_error("cta::ArchiveJob::failed(): not implemented");
throw std::runtime_error("cta::ArchiveJob::failed(): not implemented");
}
//------------------------------------------------------------------------------
// retry
//------------------------------------------------------------------------------
void cta::ArchiveJob::retry() {
//throw std::runtime_error("cta::ArchiveJob::retry(): not implemented");
throw std::runtime_error("cta::ArchiveJob::retry(): not implemented");
}
......@@ -50,12 +50,12 @@ void cta::RetrieveJob::complete() {
// failed
//------------------------------------------------------------------------------
void cta::RetrieveJob::failed() {
//throw std::runtime_error("cta::RetrieveJob::failed(): not implemented");
throw std::runtime_error("cta::RetrieveJob::failed(): not implemented");
}
//------------------------------------------------------------------------------
// retry
//------------------------------------------------------------------------------
void cta::RetrieveJob::retry() {
//throw std::runtime_error("cta::RetrieveJob::retry(): not implemented");
throw std::runtime_error("cta::RetrieveJob::retry(): not implemented");
}
......@@ -174,11 +174,42 @@ void RecallReportPacker::WorkerThread::run(){
break;
}
}
}
catch(const castor::exception::Exception& e){
} catch(const castor::exception::Exception& e){
//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
std::stringstream ssEx;
ssEx << "Tried to report and got a castor exception, cant do much more. The exception is the following: " << e.getMessageValue();
m_parent.m_lc.log(LOG_ERR, ssEx.str());
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
} catch(const cta::exception::Exception& e){
//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
std::stringstream ssEx;
ssEx << "Tried to report and got a CTA exception, cant do much more. The exception is the following: " << e.getMessageValue();
m_parent.m_lc.log(LOG_ERR, ssEx.str());
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
} catch(const std::exception& e){
//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
std::stringstream ssEx;
ssEx << "Tried to report and got a standard exception, cant do much more. The exception is the following: " << e.what();
m_parent.m_lc.log(LOG_ERR, ssEx.str());
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
}
} catch(...){
//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.m_lc.log(LOG_ERR,"tried to report endOfSession(WithError) and got an exception, cant do much more");
std::stringstream ssEx;
ssEx << "Tried to report and got an unknown exception, cant do much more.";
m_parent.m_lc.log(LOG_ERR, ssEx.str());
if (m_parent.m_watchdog) {
m_parent.m_watchdog->addToErrorCount("Error_clientCommunication");
m_parent.m_watchdog->addParameter(log::Param("status","failure"));
......
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