Skip to content
Snippets Groups Projects
Commit a5ce4079 authored by Michael Davis's avatar Michael Davis
Browse files

[os-generic-queues] Garbage collector child thread catches all types of exceptions

parent e4a5a812
Branches
Tags
No related merge requests found
......@@ -77,7 +77,7 @@ void cta::objectstore::Agent::removeAndUnregisterSelf(log::LogContext & lc) {
if (!isEmpty()) {
std::list<std::string> ownershipList = getOwnershipList();
std::stringstream exSs;
exSs << "In Agent::deleteAndUnregisterSelf: agent still owns objects. Here's the list:";
exSs << "In Agent::removeAndUnregisterSelf: agent still owns objects. Here's the list:";
for(auto i=ownershipList.begin(); i!=ownershipList.end(); i++) {
exSs << " " << *i;
}
......
......@@ -175,6 +175,7 @@ queueForFailure:;
.add("commitUnlockQueueTime", commitUnlockQueueTime);
lc.log(log::INFO, "In RetrieveRequest::garbageCollect(): queued the request to the failed queue.");
}
return;
}
// Find the corresponding tape file, which will give the copynb, which will allow finding the retrieve job.
......
......@@ -37,6 +37,11 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
utils::Timer t2, roundTime;
auto archiveJobsToReport = m_scheduler.getNextArchiveJobsToReportBatch(BATCH_SIZE, lc);
{
log::ScopedParamContainer params(lc);
params.add("jobsToReport", archiveJobsToReport.size());
lc.log(cta::log::DEBUG,"In DiskReportRunner::runOnePass(): ready to process archive reports.");
}
is_done = archiveJobsToReport.empty();
if(!archiveJobsToReport.empty()) {
timings.insertAndReset("getArchiveJobsToReportTime", t2);
......@@ -47,6 +52,11 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
}
auto retrieveJobsToReport = m_scheduler.getNextRetrieveJobsToReportBatch(BATCH_SIZE, lc);
{
log::ScopedParamContainer params(lc);
params.add("jobsToReport", retrieveJobsToReport.size());
lc.log(cta::log::DEBUG,"In DiskReportRunner::runOnePass(): ready to process retrieve reports.");
}
is_done = retrieveJobsToReport.empty();
if(!retrieveJobsToReport.empty()) {
timings.insertAndReset("getRetrieveJobsToReportTime", t2);
......@@ -59,7 +69,7 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
log::ScopedParamContainer params(lc);
params.add("roundCount", roundCount)
.add("passTime", t.secs());
lc.log(log::INFO, "In ReporterProcess::runOnePass(): finished one pass.");
lc.log(log::INFO, "In DiskReportRunner::runOnePass(): finished one pass.");
}
} // namespace cta
......@@ -319,14 +319,22 @@ int MaintenanceHandler::runChild() {
} while (!receivedMessage);
m_processManager.logContext().log(log::INFO,
"In MaintenanceHandler::runChild(): Received shutdown message. Exiting.");
} catch (cta::exception::Exception & ex) {
} catch(cta::exception::Exception & ex) {
{
log::ScopedParamContainer params(m_processManager.logContext());
params.add("Message", ex.getMessageValue());
m_processManager.logContext().log(log::ERR,
"In MaintenanceHandler::runChild(): received an exception. Backtrace follows.");
m_processManager.logContext().log(log::ERR,
"In MaintenanceHandler::runChild(): received an exception. Backtrace follows.");
}
m_processManager.logContext().logBacktrace(log::ERR, ex.backtrace());
} catch(std::exception &ex) {
log::ScopedParamContainer params(m_processManager.logContext());
params.add("Message", ex.what());
m_processManager.logContext().log(log::ERR,
"In MaintenanceHandler::runChild(): received a std::exception.");
} catch(...) {
m_processManager.logContext().log(log::ERR,
"In MaintenanceHandler::runChild(): received an unknown exception.");
}
agentHeartbeat.stopAndWaitThread();
return EXIT_SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment