Commit 2a1bbf46 authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Added extra informations in the Tape session finished log

parent 56120543
...@@ -505,7 +505,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) { ...@@ -505,7 +505,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) {
// 10) Check logs // 10) Check logs
std::string logToCheck = logger.getLog(); std::string logToCheck = logger.getLog();
logToCheck += ""; logToCheck += "";
std::cout<<"log to check = "<<logToCheck; ASSERT_NE(std::string::npos,logToCheck.find("MSG=\"Tape session started\" thread=\"TapeRead\" tapeDrive=\"T10D6116\" tapeVid=\"TstVid\" "
"mountId=\"1\" vo=\"vo\" mediaType=\"TestMediaType\" tapePool=\"TestTapePool\" "
"logicalLibrary=\"TestLogicalLibrary\" mountType=\"Retrieve\" vendor=\"TestVendor\" "
"capacityInBytes=\"12345678\""));
ASSERT_NE(std::string::npos, logToCheck.find("firmwareVersion=\"123A\" serialNumber=\"123456\" " ASSERT_NE(std::string::npos, logToCheck.find("firmwareVersion=\"123A\" serialNumber=\"123456\" "
"mountTotalCorrectedReadErrors=\"5\" mountTotalReadBytesProcessed=\"4096\" " "mountTotalCorrectedReadErrors=\"5\" mountTotalReadBytesProcessed=\"4096\" "
"mountTotalUncorrectedReadErrors=\"1\" mountTotalNonMediumErrorCounts=\"2\"")); "mountTotalUncorrectedReadErrors=\"1\" mountTotalNonMediumErrorCounts=\"2\""));
...@@ -1689,7 +1692,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) { ...@@ -1689,7 +1692,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
// Check logs for drive statistics // Check logs for drive statistics
std::string logToCheck = logger.getLog(); std::string logToCheck = logger.getLog();
logToCheck += ""; logToCheck += "";
std::cout<<logToCheck<<std::endl; ASSERT_NE(std::string::npos,logToCheck.find("MSG=\"Tape session started\" thread=\"TapeWrite\" tapeDrive=\"T10D6116\" tapeVid=\"TstVid\" mountId=\"1\" "
"lastFseq=\"0\" compression=\"1\" useLbp=\"0\" vo=\"vo\" "
"mediaType=\"TestMediaType\" tapePool=\"TestTapePool\" logicalLibrary=\"TestLogicalLibrary\" "
"mountType=\"Archive\" vendor=\"TestVendor\" capacityInBytes=\"12345678\""));
ASSERT_NE(std::string::npos, logToCheck.find("firmwareVersion=\"123A\" serialNumber=\"123456\" " ASSERT_NE(std::string::npos, logToCheck.find("firmwareVersion=\"123A\" serialNumber=\"123456\" "
"mountTotalCorrectedWriteErrors=\"5\" mountTotalUncorrectedWriteErrors=\"1\" " "mountTotalCorrectedWriteErrors=\"5\" mountTotalUncorrectedWriteErrors=\"1\" "
"mountTotalWriteBytesProcessed=\"4096\" mountTotalNonMediumErrorCounts=\"2\"")); "mountTotalWriteBytesProcessed=\"4096\" mountTotalNonMediumErrorCounts=\"2\""));
......
...@@ -220,15 +220,17 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -220,15 +220,17 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
try{ try{
// Report the parameters of the session to the main thread // Report the parameters of the session to the main thread
typedef cta::log::Param Param; typedef cta::log::Param Param;
m_watchdog.addParameter(Param("vid", m_volInfo.vid)); m_watchdog.addParameter(Param("tapeVid", m_volInfo.vid));
m_watchdog.addParameter(Param("mountType", mountTypeToString(m_volInfo.mountType))); m_watchdog.addParameter(Param("mountType", mountTypeToString(m_volInfo.mountType)));
m_watchdog.addParameter(Param("mountId", m_volInfo.mountId)); m_watchdog.addParameter(Param("mountId", m_volInfo.mountId));
m_watchdog.addParameter(Param("tapeDrive",m_drive.config.unitName));
m_watchdog.addParameter(Param("vendor",m_retrieveMount.getVendor()));
m_watchdog.addParameter(Param("volReqId", m_volInfo.mountId)); m_watchdog.addParameter(Param("volReqId", m_volInfo.mountId));
m_watchdog.addParameter(Param("vo",m_retrieveMount.getVo())); m_watchdog.addParameter(Param("vo",m_retrieveMount.getVo()));
m_watchdog.addParameter(Param("mediaType",m_retrieveMount.getMediaType())); m_watchdog.addParameter(Param("mediaType",m_retrieveMount.getMediaType()));
m_watchdog.addParameter(Param("tapePool",m_retrieveMount.getPoolName())); m_watchdog.addParameter(Param("tapePool",m_retrieveMount.getPoolName()));
m_watchdog.addParameter(Param("logicalLibrary",m_drive.config.logicalLibrary)); m_watchdog.addParameter(Param("logicalLibrary",m_drive.config.logicalLibrary));
m_watchdog.addParameter(Param("capacityInBytes",m_retrieveMount.getCapacityInBytes()));
// Set the tape thread time in the watchdog for total time estimation in case // Set the tape thread time in the watchdog for total time estimation in case
// of crash // of crash
......
...@@ -287,15 +287,18 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() { ...@@ -287,15 +287,18 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
{ {
// Report the parameters of the session to the main thread // Report the parameters of the session to the main thread
typedef cta::log::Param Param; typedef cta::log::Param Param;
m_watchdog.addParameter(Param("vid", m_volInfo.vid)); m_watchdog.addParameter(Param("tapeVid", m_volInfo.vid));
m_watchdog.addParameter(Param("mountType", mountTypeToString(m_volInfo.mountType))); m_watchdog.addParameter(Param("mountType", mountTypeToString(m_volInfo.mountType)));
m_watchdog.addParameter(Param("mountId", m_volInfo.mountId)); m_watchdog.addParameter(Param("mountId", m_volInfo.mountId));
m_watchdog.addParameter(Param("volReqId", m_volInfo.mountId)); m_watchdog.addParameter(Param("volReqId", m_volInfo.mountId));
m_watchdog.addParameter(Param("tapeDrive",m_drive.config.unitName));
m_watchdog.addParameter(Param("vendor",m_archiveMount.getVendor()));
m_watchdog.addParameter(Param("vo",m_archiveMount.getVo())); m_watchdog.addParameter(Param("vo",m_archiveMount.getVo()));
m_watchdog.addParameter(Param("mediaType",m_archiveMount.getMediaType())); m_watchdog.addParameter(Param("mediaType",m_archiveMount.getMediaType()));
m_watchdog.addParameter(Param("tapePool",m_archiveMount.getPoolName())); m_watchdog.addParameter(Param("tapePool",m_archiveMount.getPoolName()));
m_watchdog.addParameter(Param("logicalLibrary",m_drive.config.logicalLibrary)); m_watchdog.addParameter(Param("logicalLibrary",m_drive.config.logicalLibrary));
m_watchdog.addParameter(Param("capacityInBytes",m_archiveMount.getCapacityInBytes()));
// Set the tape thread time in the watchdog for total time estimation in case // Set the tape thread time in the watchdog for total time estimation in case
// of crash // of crash
......
...@@ -231,7 +231,7 @@ void DriveHandler::kill() { ...@@ -231,7 +231,7 @@ void DriveHandler::kill() {
// If we have a subprocess, kill it and wait for completion (if needed). We do not need to keep // If we have a subprocess, kill it and wait for completion (if needed). We do not need to keep
// track of the exit state as kill() means we will not be called anymore. // track of the exit state as kill() means we will not be called anymore.
log::ScopedParamContainer params(m_processManager.logContext()); log::ScopedParamContainer params(m_processManager.logContext());
params.add("unitName", m_configLine.unitName); params.add("tapeDrive", m_configLine.unitName);
if (m_pid != -1) { if (m_pid != -1) {
params.add("SubProcessId", m_pid); params.add("SubProcessId", m_pid);
// The socket pair will be reopened on the next fork. Clean it up. // The socket pair will be reopened on the next fork. Clean it up.
......
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