Skip to content
Snippets Groups Projects
Commit e315befd authored by Jorge Camarero Vera's avatar Jorge Camarero Vera
Browse files

Resolve "fix STALE message when cta-taped is restarting"

parent e1e18770
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@
- cta/CTA#1059 - Clean up warnings reported by static analysis
- cta/CTA#1062 - cta-admin tf rm should store the diskFilePath when deleting the tape file copy
- cta/CTA#1073 - Retry failed reporting for archive jobs
- cta/CTA#1078 - fix STALE message when cta-taped is restarting
# v4.3-3
......
......@@ -619,7 +619,7 @@ common::dataStructures::TapeDrive TapeDrivesCatalogueState::setTapeDriveStatus(
const common::dataStructures::DesiredDriveState & desiredState, const common::dataStructures::MountType& type,
const common::dataStructures::DriveStatus& status, const tape::daemon::TpconfigLine& tpConfigLine,
const common::dataStructures::SecurityIdentity& identity) {
const time_t reportTime = time(NULL);
const time_t reportTime = time(nullptr);
common::dataStructures::TapeDrive tapeDriveStatus;
tapeDriveStatus.driveName = driveInfo.driveName;
tapeDriveStatus.host = driveInfo.host;
......@@ -636,8 +636,14 @@ common::dataStructures::TapeDrive TapeDrivesCatalogueState::setTapeDriveStatus(
tapeDriveStatus.reservedBytes = 0;
tapeDriveStatus.devFileName = tpConfigLine.devFilename;
tapeDriveStatus.rawLibrarySlot = tpConfigLine.rawLibrarySlot;
tapeDriveStatus.creationLog = common::dataStructures::EntryLog(identity.username, identity.host, reportTime);
tapeDriveStatus.lastModificationLog = common::dataStructures::EntryLog(identity.username, identity.host, reportTime);
if (identity.username.empty()) {
tapeDriveStatus.creationLog = common::dataStructures::EntryLog("NO_USER", driveInfo.host, reportTime);
tapeDriveStatus.lastModificationLog = common::dataStructures::EntryLog("NO_USER", driveInfo.host, reportTime);
} else {
tapeDriveStatus.creationLog = common::dataStructures::EntryLog(identity.username, identity.host, reportTime);
tapeDriveStatus.lastModificationLog = common::dataStructures::EntryLog(identity.username, identity.host,
reportTime);
}
return tapeDriveStatus;
}
......
......@@ -127,7 +127,7 @@ int DriveLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) {
else
dr_item->set_latest_bandwidth(0);
dr_item->set_session_id(dr.sessionId ? dr.sessionId.value() : 0);
const auto lastUpdateTime = dr.lastModificationLog ? dr.lastModificationLog.value().time : 0;
const auto lastUpdateTime = dr.lastModificationLog ? dr.lastModificationLog.value().time : time(nullptr);
dr_item->set_time_since_last_update(time(nullptr) - lastUpdateTime);
dr_item->set_current_priority(dr.currentPriority ? dr.currentPriority.value() : 0);
dr_item->set_current_activity(dr.currentActivity ? dr.currentActivity.value() : "");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment