Commit 6267d786 authored by Eric Cano's avatar Eric Cano
Browse files

CASTOR-5071: tapeserverd does not report the session as failed when failing to mount for recall.

parent 05523cda
......@@ -411,8 +411,8 @@ TEST(tapeServer, DataTransferSessionFailtoMount) {
std::string temp = logger.getLog();
temp += "";
ASSERT_EQ("V12345", sess.getVid());
// Currently, failures are reported by files and recall sessions do not fail.
ASSERT_EQ(0, sim.m_sessionErrorCode);
// The session is now failing (internal error is reported)
ASSERT_EQ(1015, sim.m_sessionErrorCode);
}
TEST(tapeServer, DataTransferSessionEmptyOnVolReq) {
......
......@@ -152,7 +152,7 @@ void RecallReportPacker::flush(){
//------------------------------------------------------------------------------
void RecallReportPacker::ReportEndofSession::execute(RecallReportPacker& parent){
client::ClientInterface::RequestReport chrono;
if(!parent.m_errorHappened){
if(!parent.errorHappened()){
parent.m_client.reportEndOfSession(chrono);
parent.logRequestReport(chrono,"Nominal RecallReportPacker::EndofSession has been reported",LOG_INFO);
if (parent.m_watchdog) {
......@@ -307,4 +307,12 @@ void RecallReportPacker::WorkerThread::run(){
//When we end up there, we might have still
}
//------------------------------------------------------------------------------
//errorHappened()
//------------------------------------------------------------------------------
bool RecallReportPacker::errorHappened() {
return m_errorHappened || (m_watchdog && m_watchdog->errorHappened());
}
}}}}
......@@ -87,6 +87,11 @@ public:
*/
void waitThread() { m_workerThread.wait(); }
/**
* Was there an error?
*/
bool errorHappened();
private:
//inner classes use to store content while receiving a report
class Report {
......
......@@ -133,7 +133,7 @@ protected:
castor::server::BlockingQueue<castor::log::Param> m_paramsQueue;
/**
*
* Map of all error counts
*/
std::map<std::string, uint32_t> m_errorCounts;
......@@ -343,6 +343,14 @@ protected:
addParameter(log::Param(errorName, value));
}
/**
* Test whether an error happened
*/
bool errorHappened() {
castor::server::MutexLocker locker(&m_mutex);
return m_errorCounts.size();
}
/**
* Start the 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