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

Resolve "Avoid looping in Cleaning Up state"

parent 77db33eb
Branches
Tags
No related merge requests found
......@@ -11,6 +11,7 @@
- cta/CTA#473 - Fix some code smells from repack expansion changes.
- cta/CTA#494 - Workaround for scheduler crashing
- cta/CTA#500 - Safely handle empty shards in object store
- cta/CTA#509 - Avoid looping in cleaning up state
### Features
- cta/CTA#490 - Improve code quality in the Physical Library catalogue code
......
......@@ -902,6 +902,8 @@ int DriveHandler::runChild() {
std::set<SessionState> statesRequiringCleaner = {SessionState::Mounting,
SessionState::Running, SessionState::Unmounting};
if (m_previousSession == PreviousSession::Crashed && statesRequiringCleaner.count(m_previousState)) {
// Set session type to cleanup
m_sessionType = SessionType::Cleanup;
if (m_previousVid.empty()) {
int logLevel = log::ERR;
std::string errorMsg = "In DriveHandler::runChild(): Should run cleaner but VID is missing. Putting the drive down.";
......@@ -1171,6 +1173,8 @@ SubprocessHandler::ProcessingStatus DriveHandler::shutdown() {
driveInfo.driveName = m_driveConfig.unitName;
driveInfo.logicalLibrary = m_driveConfig.logicalLibrary;
driveInfo.host = cta::utils::getShortHostname();
// Set session type to cleanup
m_sessionType = SessionType::Cleanup;
scheduler->reportDriveStatus(driveInfo, cta::common::dataStructures::MountType::NoMount,
cta::common::dataStructures::DriveStatus::CleaningUp, lc);
log::ScopedParamContainer scoped(m_processManager.logContext());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment