Commit 2d6f22fa authored by Eric Cano's avatar Eric Cano
Browse files

Fixed missing tape logs stats update at the end of each file transmission in...

Fixed missing tape logs stats update at the end of each file transmission in migration and in case of error
in both migrations and recalls.
parent 0d33113f
...@@ -228,6 +228,9 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -228,6 +228,9 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// Report one last time the stats, after unloading/unmounting. // Report one last time the stats, after unloading/unmounting.
m_watchdog.updateStats(m_stats); m_watchdog.updateStats(m_stats);
} catch(const castor::exception::Exception& e){ } catch(const castor::exception::Exception& e){
// We can still update the session stats one last time (unmount timings
// should have been updated by the RAII cleaner/unmounter).
m_watchdog.updateStats(m_stats);
// We end up here because one step failed, be it at mount time, of after // We end up here because one step failed, be it at mount time, of after
// failing to position by fseq (this is fatal to a read session as we need // failing to position by fseq (this is fatal to a read session as we need
// to know where we are to proceed to the next file incrementally in fseq // to know where we are to proceed to the next file incrementally in fseq
......
...@@ -205,6 +205,8 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() { ...@@ -205,6 +205,8 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
task->execute(*writeSession,m_reportPacker,m_watchdog,m_logContext,timer); task->execute(*writeSession,m_reportPacker,m_watchdog,m_logContext,timer);
// Add the tasks counts to the session's // Add the tasks counts to the session's
m_stats.add(task->getTaskStats()); m_stats.add(task->getTaskStats());
// Transmit the statistics to the watchdog thread
m_watchdog.updateStats(m_stats);
// Increase local flush counters (session counters are incremented by // Increase local flush counters (session counters are incremented by
// the task) // the task)
files++; files++;
...@@ -239,6 +241,9 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() { ...@@ -239,6 +241,9 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// like mounting the tape, then we have to signal the problem to the disk // like mounting the tape, then we have to signal the problem to the disk
// side and the task injector, which will trigger the end of session. // side and the task injector, which will trigger the end of session.
m_injector->setErrorFlag(); m_injector->setErrorFlag();
// We can still update the session stats one last time (unmount timings
// should have been updated by the RAII cleaner/unmounter).
m_watchdog.updateStats(m_stats);
// If we reached the end of tape, this is not an error (ENOSPC) // If we reached the end of tape, this is not an error (ENOSPC)
try { try {
......
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