Commit 1849678a authored by David COME's avatar David COME
Browse files

TapeWriteSingleThread : fixing

initialized some mebers that were not and a some log in case of error while opening the session
parent d3c21d6d
...@@ -46,6 +46,7 @@ public: ...@@ -46,6 +46,7 @@ public:
MigrationReportPacker & repPacker, MigrationReportPacker & repPacker,
int filesBeforeFlush, int blockBeforeFlush): int filesBeforeFlush, int blockBeforeFlush):
TapeSingleThreadInterface<TapeWriteTaskInterface>(drive, vid, lc), TapeSingleThreadInterface<TapeWriteTaskInterface>(drive, vid, lc),
m_filesBeforeFlush(filesBeforeFlush),m_blocksBeforeFlush(blockBeforeFlush),
m_drive(drive), m_reportPacker(repPacker), m_lastFseq(0), m_compress(0) {} m_drive(drive), m_reportPacker(repPacker), m_lastFseq(0), m_compress(0) {}
private: private:
...@@ -73,8 +74,10 @@ private: ...@@ -73,8 +74,10 @@ private:
rs.reset(new castor::tape::tapeFile::WriteSession(m_drive,m_vid,m_lastFseq,m_compress)); rs.reset(new castor::tape::tapeFile::WriteSession(m_drive,m_vid,m_lastFseq,m_compress));
m_logContext.log(LOG_INFO, "Tape Write session session successfully started"); m_logContext.log(LOG_INFO, "Tape Write session session successfully started");
} }
catch (castor::exception::Exception & ex) { catch (castor::exception::Exception & e) {
m_logContext.log(LOG_ERR, "Failed to start tape read session"); ScopedParam sp0(m_logContext, Param("ErrorMessage", e.getMessageValue()));
ScopedParam sp1(m_logContext, Param("ErrorCode", e.code()));
m_logContext.log(LOG_ERR, "Failed to start tape write session");
// TODO: log and unroll the session // TODO: log and unroll the session
// TODO: add an unroll mode to the tape read task. (Similar to exec, but pushing blocks marked in error) // TODO: add an unroll mode to the tape read task. (Similar to exec, but pushing blocks marked in error)
throw; throw;
...@@ -128,8 +131,8 @@ private: ...@@ -128,8 +131,8 @@ private:
} }
} }
int m_filesBeforeFlush; const int m_filesBeforeFlush;
int m_blocksBeforeFlush; const int m_blocksBeforeFlush;
castor::tape::drives::DriveInterface& m_drive; castor::tape::drives::DriveInterface& m_drive;
MigrationReportPacker & m_reportPacker; MigrationReportPacker & m_reportPacker;
......
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