Skip to content
Snippets Groups Projects
Commit 03182b33 authored by Steven Murray's avatar Steven Murray
Browse files

Improved the tapeserverd logs

parent 5d86158f
Branches
Tags
No related merge requests found
......@@ -236,19 +236,20 @@ void castor::tape::tapeserver::daemon::TapeDaemon::registerTapeDriveWithVdqm(
switch(driveState) {
case DriveCatalogue::DRIVE_STATE_DOWN:
params.push_back(log::Param("state", "down"));
m_log(LOG_INFO, "Registering tape drive", params);
m_log(LOG_INFO, "Registering tape drive in vdqm", params);
m_vdqm.setTapeDriveStatusDown(m_hostName, unitName, dgn);
break;
case DriveCatalogue::DRIVE_STATE_UP:
params.push_back(log::Param("state", "up"));
m_log(LOG_INFO, "Registering tape drive", params);
m_log(LOG_INFO, "Registering tape drive in vdqm", params);
m_vdqm.setTapeDriveStatusUp(m_hostName, unitName, dgn);
break;
default:
{
castor::exception::Internal ex;
ex.getMessage() << "Failed to register tape drive " << unitName <<
" in dgn " << dgn << ": Invalid drive state: state=" <<
ex.getMessage() << "Failed to register tape drive in vdqm"
": server=" << m_hostName << " unitName=" << unitName << " dgn=" << dgn
<< ": Invalid drive state: state=" <<
DriveCatalogue::driveState2Str(driveState);
throw ex;
}
......
......@@ -107,10 +107,6 @@ void castor::tape::tapeserver::daemon::VdqmImpl::setTapeDriveStatus(
//-----------------------------------------------------------------------------
int castor::tape::tapeserver::daemon::VdqmImpl::connectToVdqm()
const throw(castor::exception::Exception) {
timeval connectStartTime = {0, 0};
timeval connectEndTime = {0, 0};
castor::utils::getTimeOfDay(&connectStartTime, NULL);
castor::utils::SmartFd smartConnectSock;
try {
smartConnectSock.reset(io::connectWithTimeout(m_vdqmHostName, m_vdqmPort,
......@@ -122,16 +118,6 @@ int castor::tape::tapeserver::daemon::VdqmImpl::connectToVdqm()
throw ex;
}
const double connectDurationSecs = castor::utils::timevalToDouble(
castor::utils::timevalAbsDiff(connectStartTime, connectEndTime));
{
log::Param params[] = {
log::Param("vdqmHostName", m_vdqmHostName),
log::Param("vdqmPort", m_vdqmPort),
log::Param("connectDurationSecs", connectDurationSecs)};
m_log(LOG_INFO, "Connected to vdqm", params);
}
return smartConnectSock.release();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment