Commit 80d2fa4f authored by Eric Cano's avatar Eric Cano
Browse files

Changed log levels for the special case of end of tape, which is not an error.

parent 6994f150
...@@ -228,7 +228,7 @@ namespace daemon { ...@@ -228,7 +228,7 @@ namespace daemon {
}//end of try }//end of try
catch(const castor::tape::tapeserver::daemon::ErrorFlag&){ catch(const castor::tape::tapeserver::daemon::ErrorFlag&){
//we end up there because a task screw up somewhere //we end up there because a task screw up somewhere
m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): a task failed, " m_parent.m_lc.log(LOG_INFO,"In MigrationTaskInjector::WorkerThread::run(): a task failed, "
"indicating finish of run"); "indicating finish of run");
m_parent.signalEndDataMovement(); m_parent.signalEndDataMovement();
......
...@@ -178,20 +178,24 @@ namespace daemon { ...@@ -178,20 +178,24 @@ namespace daemon {
} }
//log and circulate blocks //log and circulate blocks
//We want to report internal error most of the time to avoid wrong // We want to report internal error most of the time to avoid wrong
// interpretation down the chain. Nevertheless, if the exception // interpretation down the chain. Nevertheless, if the exception
// if of type Errnum AND the errorCode is ENOSPC, we will propagate it. // if of type Errnum AND the errorCode is ENOSPC, we will propagate it.
// This is how we communicate the fact that a tape is full to the client. // This is how we communicate the fact that a tape is full to the client.
// We also change the log level to INFO for the case of end of tape.
int errorCode = e.code(); int errorCode = e.code();
int errorLevel = LOG_ERR;
try { try {
const castor::exception::Errnum & errnum = const castor::exception::Errnum & errnum =
dynamic_cast<const castor::exception::Errnum &> (e); dynamic_cast<const castor::exception::Errnum &> (e);
if (ENOSPC == errnum.errorNumber()) if (ENOSPC == errnum.errorNumber()) {
errorCode = ENOSPC; errorCode = ENOSPC;
errorLevel = LOG_INFO;
}
} catch (...) {} } catch (...) {}
LogContext::ScopedParam sp(lc, Param("exceptionCode",errorCode)); LogContext::ScopedParam sp(lc, Param("exceptionCode",errorCode));
LogContext::ScopedParam sp1(lc, Param("exceptionMessage", e.getMessageValue())); LogContext::ScopedParam sp1(lc, Param("exceptionMessage", e.getMessageValue()));
lc.log(LOG_ERR,"An error occurred for this file. End of migrations."); lc.log(errorLevel,"An error occurred for this file. End of migrations.");
circulateMemBlocks(); circulateMemBlocks();
reportPacker.reportFailedJob(*m_fileToMigrate,e.getMessageValue(),errorCode); reportPacker.reportFailedJob(*m_fileToMigrate,e.getMessageValue(),errorCode);
......
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