Commit 0e2b69b5 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed reporting of Shutdown instead of ShuttingDown (and fixed typo in enum name).

The Shutdown state can only be used internally by the DriveHandler after process exit.
parent ae4a1b64
......@@ -147,7 +147,7 @@ void TapeServerReporter::ReportStateChange::execute(TapeServerReporter& parent)
void TapeServerReporter::ReportTapeUnmountedForRetrieve::execute(TapeServerReporter& parent) {
parent.m_tapeUnmountedForRecall=true;
if (parent.m_diskCompleteForRecall) {
parent.m_tapeserverProxy.reportState(cta::tape::session::SessionState::Shutdown,
parent.m_tapeserverProxy.reportState(cta::tape::session::SessionState::ShuttingDown,
cta::tape::session::SessionType::Retrieve, parent.m_volume.vid);
} else {
parent.m_tapeserverProxy.reportState(cta::tape::session::SessionState::DrainingToDisk,
......@@ -161,7 +161,7 @@ void TapeServerReporter::ReportTapeUnmountedForRetrieve::execute(TapeServerRepor
void TapeServerReporter::ReportDiskCompleteForRetrieve::execute(TapeServerReporter& parent) {
parent.m_diskCompleteForRecall=true;
if (parent.m_tapeUnmountedForRecall) {
parent.m_tapeserverProxy.reportState(cta::tape::session::SessionState::Shutdown,
parent.m_tapeserverProxy.reportState(cta::tape::session::SessionState::ShuttingDown,
cta::tape::session::SessionType::Retrieve, parent.m_volume.vid);
}
}
......
......@@ -106,7 +106,7 @@ castor::tape::tapeserver::daemon::TapeWriteSingleThread::TapeCleaning::~TapeClea
m_this.m_stats.unmountTime += m_timer.secs(cta::utils::Timer::resetCounter);
m_this.m_logContext.log(cta::log::INFO, cta::mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.config.librarySlot().getLibraryType() ?
"TapeWriteSingleThread : tape unmounted":"TapeWriteSingleThread : tape NOT unmounted (manual mode)");
m_this.m_initialProcess.reportState(cta::tape::session::SessionState::Shutdown,
m_this.m_initialProcess.reportState(cta::tape::session::SessionState::ShuttingDown,
cta::tape::session::SessionType::Archive);
m_this.m_stats.waitReportingTime += m_timer.secs(cta::utils::Timer::resetCounter);
}
......
......@@ -79,7 +79,7 @@ const std::map<SessionState, DriveHandler::Timeout> DriveHandler::m_stateChangeT
// Draining to disk is given a grace period of 30 minutes for changing state.
{SessionState::DrainingToDisk, std::chrono::duration_cast<Timeout>(std::chrono::minutes(30))},
// We expect the process to exit within 5 seconds of getting in this state.
{SessionState::ShutingDown, std::chrono::duration_cast<Timeout>(std::chrono::seconds(5))}
{SessionState::ShuttingDown, std::chrono::duration_cast<Timeout>(std::chrono::seconds(5))}
};
//------------------------------------------------------------------------------
......@@ -270,7 +270,7 @@ SubprocessHandler::ProcessingStatus DriveHandler::processEvent() {
return processUnmounting(message);
case SessionState::DrainingToDisk:
return processDrainingToDisk(message);
case SessionState::ShutingDown:
case SessionState::ShuttingDown:
return processShutingDown(message);
case SessionState::Fatal:
return processFatal(message);
......
......@@ -39,8 +39,8 @@ std::string toString(SessionState state) {
return "Unmounting";
case SessionState::DrainingToDisk:
return "DrainingToDisk";
case SessionState::ShutingDown:
return "ShutingDown";
case SessionState::ShuttingDown:
return "ShuttingDown";
case SessionState::Shutdown:
return "Shutdown";
case SessionState::Killed:
......
......@@ -31,7 +31,7 @@ enum class SessionState: uint32_t {
Running, ///< The subprocess is running the data transfer.
Unmounting, ///< The subprocess is unmounting the tape.
DrainingToDisk, ///< The subprocess is flushing the memory to disk (retrieves only)
ShutingDown,///< The subprocess completed all tasks and will exit
ShuttingDown, ///< The subprocess completed all tasks and will exit
Shutdown, ///< The subprocess is finished after a shutdown was requested and will not be retarted (internal state)
Killed, ///< The subprocess was killed and a restart is expected.
Fatal ///< The subprocess reported a fatal error (like scheduling inaccessible).
......
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