From c469879aefe6359d2894965da2affd68d053f197 Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Thu, 28 Sep 2017 17:17:53 +0200
Subject: [PATCH] Fixed missing handling of cleanup errors in
 ArchiveMount::getNextJobBatch().

A benign exception failed to be caught and led to unnecessary errors.
---
 scheduler/OStoreDB/OStoreDB.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp
index 318939fdb3..22ac43e322 100644
--- a/scheduler/OStoreDB/OStoreDB.cpp
+++ b/scheduler/OStoreDB/OStoreDB.cpp
@@ -1828,6 +1828,12 @@ std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> > OStoreDB::ArchiveMoun
                 .add("queueObject", aq.getAddressIfSet())
                 .add("Message", ex.getMessageValue());
           logContext.log(log::INFO, "In ArchiveMount::getNextJobBatch(): could not de-referenced missing queue from root entry");
+        } catch (RootEntry::NoSuchArchiveQueue & ex) {
+          // Somebody removed the queue in the mean time. Barely worth mentioning.
+          log::ScopedParamContainer params(logContext);
+          params.add("tapepool", mountInfo.tapePool)
+                .add("queueObject", aq.getAddressIfSet());
+          logContext.log(log::DEBUG, "In ArchiveMount::getNextJobBatch(): could not de-referenced missing queue from root entry: already done.");
         }
         emptyQueueCleanupTime += t.secs(utils::Timer::resetCounter);
         continue;
-- 
GitLab