From 63d68ffdbdc095a263b6cc0f2ad106e4b9e4ae1d Mon Sep 17 00:00:00 2001 From: Michael Davis <michael.davis@cern.ch> Date: Wed, 23 Jan 2019 15:28:27 +0100 Subject: [PATCH] [os-failedrequests] Implements cta-admin failedjobs ls -S --- objectstore/ArchiveQueue.cpp | 6 +++--- scheduler/OStoreDB/OStoreDB.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/objectstore/ArchiveQueue.cpp b/objectstore/ArchiveQueue.cpp index e0ae0c3f8b..a44e8241c5 100644 --- a/objectstore/ArchiveQueue.cpp +++ b/objectstore/ArchiveQueue.cpp @@ -564,9 +564,9 @@ auto ArchiveQueue::getCandidateList(uint64_t maxBytes, uint64_t maxFiles, std::s auto ArchiveQueue::getCandidateSummary() -> CandidateJobList { checkPayloadReadable(); CandidateJobList ret; - for(auto & rqsp: m_payload.archivequeueshards()) { - ret.candidateBytes += rqsp.shardbytescount(); - ret.candidateFiles += rqsp.shardjobscount(); + for(auto & aqsp: m_payload.archivequeueshards()) { + ret.candidateBytes += aqsp.shardbytescount(); + ret.candidateFiles += aqsp.shardjobscount(); } return ret; } diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index b2fb41a718..2015c684f8 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -704,6 +704,15 @@ SchedulerDatabase::JobsFailedSummary OStoreDB::getArchiveJobsFailedSummary(log:: auto queueList = re.dumpArchiveQueues(QueueType::FailedJobs); for(auto &aj : queueList) { ArchiveQueue aq(aj.address, m_objectStore); + try { + aq.fetchNoLock(); + } catch (cta::exception::Exception &ex) { + log::ScopedParamContainer params (logContext); + params.add("queueObject", aj.address) + .add("exceptionMessage", ex.getMessageValue()); + logContext.log(log::WARNING, "In OStoreDB::getArchiveJobsFailedSummary(): failed to lock/fetch an archive queue."); + continue; + } auto summary = aq.getCandidateSummary(); ret.totalFiles += summary.candidateFiles; ret.totalBytes += summary.candidateBytes; @@ -1144,6 +1153,15 @@ SchedulerDatabase::JobsFailedSummary OStoreDB::getRetrieveJobsFailedSummary(log: auto queueList = re.dumpRetrieveQueues(QueueType::FailedJobs); for(auto &rj : queueList) { RetrieveQueue rq(rj.address, m_objectStore); + try { + rq.fetchNoLock(); + } catch (cta::exception::Exception &ex) { + log::ScopedParamContainer params (logContext); + params.add("queueObject", rj.address) + .add("exceptionMessage", ex.getMessageValue()); + logContext.log(log::WARNING, "In OStoreDB::getRetrieveJobsFailedSummary(): failed to lock/fetch a retrieve queue."); + continue; + } auto summary = rq.getCandidateSummary(); ret.totalFiles += summary.candidateFiles; ret.totalBytes += summary.candidateBytes; -- GitLab