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

Renamed the error counts to Error_... for easy counting and future proof parsing in the tape log.

parent bdb84c35
......@@ -63,13 +63,13 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
//because the disk could the very reason why the previous one failed,
//so dont do the same mistake twice !
checkMigrationFailing();
currentErrorToCount = "diskOpenForReadErrorCount";
currentErrorToCount = "Error_diskOpenForRead";
std::auto_ptr<tape::diskFile::ReadFile> sourceFile(
fileFactory.createReadFile(m_migratedFile->path()));
log::ScopedParamContainer URLcontext(lc);
URLcontext.add("path", m_migratedFile->path())
.add("actualURL", sourceFile->URL());
currentErrorToCount = "diskFileToReadSizeMismatchCount";
currentErrorToCount = "Error_diskFileToReadSizeMismatch";
if(migratingFileSize != sourceFile->size()){
throw castor::exception::Exception("Mismtach between size given by the client "
"and the real one");
......@@ -92,7 +92,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
mb->m_fileid = m_migratedFile->fileid();
mb->m_fileBlock = blockId++;
currentErrorToCount = "diskReadErrorCount";
currentErrorToCount = "Error_diskRead";
migratingFileSize -= mb->m_payload.read(*sourceFile);
m_stats.readWriteTime+=localTime.secs(castor::utils::Timer::resetCounter);
......@@ -100,7 +100,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
//we either read at full capacity (ie size=capacity) or if there different,
//it should be the end => migratingFileSize should be 0. If it not, error
currentErrorToCount = "diskUnexpectedSizeWhenReadingCount";
currentErrorToCount = "Error_diskUnexpectedSizeWhenReading";
if(mb->m_payload.size() != mb->m_payload.totalCapacity() && migratingFileSize>0){
std::string erroMsg = "Error while reading a file. Did not read at full capacity but the file is not fully read";
mb->markAsFailed(erroMsg,SEINTERNAL);
......
......@@ -87,7 +87,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
if (!writeFile.get()) {
lc.log(LOG_DEBUG, "About to open disk file for writing");
// Synchronise the counter with the open time counter.
currentErrorToCount = "diskOpenForWriteErrorCount";
currentErrorToCount = "Error_diskOpenForWrite";
transferTime = localTime;
writeFile.reset(fileFactory.createWriteFile(m_recallingFile->path()));
URLcontext.add("actualURL", writeFile->URL());
......@@ -96,7 +96,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
}
// Write the data.
currentErrorToCount = "diskWriteErrorCount";
currentErrorToCount = "Error_diskWrite";
m_stats.dataVolume+=mb->m_payload.size();
mb->m_payload.write(*writeFile);
m_stats.readWriteTime+=localTime.secs(castor::utils::Timer::resetCounter);
......@@ -111,7 +111,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//close has to be explicit, because it may throw.
//A close is done in WriteFile's destructor, but it may lead to some
//silent data loss
currentErrorToCount = "diskCloseAfterWriteErrorCount";
currentErrorToCount = "Error_diskCloseAfterWrite";
writeFile->close();
m_stats.closingTime +=localTime.secs(castor::utils::Timer::resetCounter);
m_stats.filesCount++;
......
......@@ -54,7 +54,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std::string currentErrorToCount = "tapeUnloadErrorCount";
std::string currentErrorToCount = "Error_tapeUnload";
try {
// Do the final cleanup
// in the special case of a "manual" mode tape, we should skip the unload too.
......@@ -68,7 +68,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
// And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing)
currentErrorToCount = "tapeDismountErrorCount";
currentErrorToCount = "Error_tapeDismount";
m_this.m_mc.dismountTape(m_this.m_volInfo.vid, m_this.m_drive.librarySlot.str());
m_this.m_stats.unmountTime += m_timer.secs(castor::utils::Timer::resetCounter);
m_this.m_logContext.log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.librarySlot.getLibraryType() ?
......@@ -147,7 +147,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::openReadSession() {
void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext.pushOrReplace(log::Param("thread", "TapeRead"));
castor::utils::Timer timer, totalTimer;
std::string currentErrorToCount = "failedToSetCapabilitiesCount";
std::string currentErrorToCount = "Error_setCapabilities";
try{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
// through the st driver file descriptor.
......@@ -171,9 +171,9 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// will also take care of the TapeServerReporter and of RecallTaskInjector
TapeCleaning tapeCleaner(*this, timer);
// Before anything, the tape should be mounted
currentErrorToCount = "tapeFailedToMountForReadCount";
currentErrorToCount = "Error_tapeMountForRead";
mountTapeReadOnly();
currentErrorToCount = "tapeFailedToLoadCount";
currentErrorToCount = "Error_tapeLoad";
waitForDrive();
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter);
{
......@@ -182,7 +182,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext.log(LOG_INFO, "Tape mounted and drive ready");
}
// Then we have to initialise the tape read session
currentErrorToCount = "tapeFailedToCheckLabelBeforeReadingCount";
currentErrorToCount = "Error_tapesCheckLabelBeforeReading";
std::auto_ptr<castor::tape::tapeFile::ReadSession> rs(openReadSession());
// From now on, the tasks will identify problems when executed.
currentErrorToCount = "";
......
......@@ -95,7 +95,7 @@ public:
std::string currentErrorToCount = "";
MemBlock* mb=NULL;
try {
currentErrorToCount = "tapeFailedToPositionForReadCount";
currentErrorToCount = "Error_tapePositionForRead";
std::auto_ptr<castor::tape::tapeFile::ReadFile> rf(openReadFile(rs,lc));
// At that point we already read the header.
localStats.headerVolume += TapeSessionStats::headerVolumePerFile;
......@@ -104,7 +104,7 @@ public:
localStats.positionTime += timer.secs(castor::utils::Timer::resetCounter);
watchdog.notifyBeginNewJob(*m_fileToRecall);
localStats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter);
currentErrorToCount = "tapeReadDataError";
currentErrorToCount = "Error_tapeReadData";
while (stillReading) {
// Get a memory block and add information to its metadata
mb=m_mm.getFreeBlock();
......
......@@ -127,7 +127,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std::string currentErrorToCount = "failedToSetCapabilitiesCount";
std::string currentErrorToCount = "Error_setCapabilities";
try
{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
......@@ -155,13 +155,13 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// will also take care of the TapeServerReporter
//
TapeCleaning cleaner(*this, timer);
currentErrorToCount = "tapeFailedToMountForWriteCount";
currentErrorToCount = "Error_tapeMountForWrite";
// Before anything, the tape should be mounted
// This call does the logging of the mount
mountTapeReadWrite();
currentErrorToCount = "tapeFailedToLoadCount";
currentErrorToCount = "Error_tapeLoad";
waitForDrive();
currentErrorToCount = "tapeNotWriteableCount";
currentErrorToCount = "Error_tapeNotWriteable";
isTapeWritable();
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter);
......@@ -170,7 +170,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
scoped.add("mountTime", m_stats.mountTime);
m_logContext.log(LOG_INFO, "Tape mounted and drive ready");
}
currentErrorToCount = "tapeFailedToPositionForWriteCount";
currentErrorToCount = "Error_tapePositionForWrite";
// Then we have to initialize the tape write session
std::auto_ptr<castor::tape::tapeFile::WriteSession> writeSession(openWriteSession());
m_stats.positionTime += timer.secs(castor::utils::Timer::resetCounter);
......@@ -211,7 +211,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
bytes+=task->fileSize();
//if one flush counter is above a threshold, then we flush
if (files >= m_filesBeforeFlush || bytes >= m_bytesBeforeFlush) {
currentErrorToCount = "tapeFailedToFlushCount";
currentErrorToCount = "Error_tapeFlush";
tapeFlush("Normal flush because thresholds was reached",bytes,files,timer);
files=0;
bytes=0;
......
......@@ -100,7 +100,7 @@ private:
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std::string currentErrorToCount = "tapeUnloadErrorCount";
std::string currentErrorToCount = "Error_tapeUnload";
try{
// Do the final cleanup
// in the special case of a "manual" mode tape, we should skip the unload too.
......@@ -114,7 +114,7 @@ private:
// And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing)
currentErrorToCount = "tapeDismountErrorCount";
currentErrorToCount = "Error_tapeDismount";
m_this.m_mc.dismountTape(m_this.m_volInfo.vid, m_this.m_drive.librarySlot.str());
m_this.m_stats.unmountTime += m_timer.secs(castor::utils::Timer::resetCounter);
m_this.m_logContext.log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.librarySlot.getLibraryType() ?
......
......@@ -89,11 +89,11 @@ namespace daemon {
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std::string currentErrorToCount = "tapeFSeqOutOfSequenceForWriteCount";
std::string currentErrorToCount = "Error_tapeFSeqOutOfSequenceForWrite";
session.validateNextFSeq(m_fileToMigrate->fseq());
try {
//try to open the session
currentErrorToCount = "tapeWriteHeaderErrorCount";
currentErrorToCount = "Error_tapeWriteHeader";
watchdog.notifyBeginNewJob(*m_fileToMigrate);
std::auto_ptr<castor::tape::tapeFile::WriteFile> output(openWriteFile(session,lc));
m_taskStats.transferTime += timer.secs(castor::utils::Timer::resetCounter);
......@@ -110,7 +110,7 @@ namespace daemon {
ckSum = mb->m_payload.adler32(ckSum);
m_taskStats.checksumingTime += timer.secs(castor::utils::Timer::resetCounter);
currentErrorToCount = "tapeWriteDataErrorCount";
currentErrorToCount = "Error_tapeWriteData";
mb->m_payload.write(*output);
currentErrorToCount = "";
......@@ -122,7 +122,7 @@ namespace daemon {
//finish the writing of the file on tape
//put the trailer
currentErrorToCount = "tapeWriteTrailerErrorCount";
currentErrorToCount = "Error_tapeWriteTrailer";
output->close();
currentErrorToCount = "";
m_taskStats.transferTime += timer.secs(castor::utils::Timer::resetCounter);
......
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