Commit d6427ef0 authored by Eric Cano's avatar Eric Cano
Browse files

Added logging of the tape alerts at the beginning of the mount sessions.

parent 29b2ddcc
......@@ -175,6 +175,8 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
mountTapeReadOnly();
currentErrorToCount = "Error_tapeLoad";
waitForDrive();
currentErrorToCount = "Error_checkingTapeAlert";
logTapeAlerts();
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter);
{
castor::log::ScopedParamContainer scoped(m_logContext);
......
......@@ -176,6 +176,25 @@ protected:
throw;
}
}
/**
* After waiting for the drive, we will dump the tape alert log content, if
* not empty
*/
void logTapeAlerts() {
std::vector<std::string> tapeAlerts = m_drive.getTapeAlerts();
if (tapeAlerts.empty()) return;
size_t alertNumber = 0;
for (std::vector<std::string>::iterator ta=tapeAlerts.begin();
ta!=tapeAlerts.end();ta++)
{
log::ScopedParamContainer params(m_logContext);
params.add("tapeAlert",*ta)
.add("tapeAlertNumber", alertNumber++)
.add("tapeAlertCount", tapeAlerts.size());
m_logContext.log(LOG_WARNING, "Tape alert detected");
}
}
public:
Session::EndOfSessionAction getHardwareStatus() const {
......
......@@ -161,6 +161,8 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
mountTapeReadWrite();
currentErrorToCount = "Error_tapeLoad";
waitForDrive();
currentErrorToCount = "Error_checkingTapeAlert";
logTapeAlerts();
currentErrorToCount = "Error_tapeNotWriteable";
isTapeWritable();
......
......@@ -79,7 +79,8 @@ castor::tape::tapeserver::drive::positionInfo castor::tape::tapeserver::drive::F
return pos;
}
std::vector<std::string> castor::tape::tapeserver::drive::FakeDrive::getTapeAlerts() {
throw castor::exception::Exception("FakeDrive::getTapeAlerts Not implemented");
std::vector<std::string> empty;
return empty;
}
void castor::tape::tapeserver::drive::FakeDrive::setDensityAndCompression(bool compression, unsigned char densityCode) {
throw castor::exception::Exception("FakeDrive::setDensityAndCompression Not implemented");
......
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