diff --git a/objectstore/ArchiveQueue.cpp b/objectstore/ArchiveQueue.cpp index e0ae0c3f8b782ea3a2c46a191177c8aa6604d2c7..a44e8241c5c16dde04a34bf93e7120ac10713227 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 b2fb41a7180ba7e781f5f96eafcf3244ead56393..2015c684f81d9e9eaca20f93d9cf1c5c1e42b073 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;