Commit b944306c authored by Eric Cano's avatar Eric Cano
Browse files

Disregard possible leftover session for current drive.

parent facb720a
......@@ -142,6 +142,7 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo>
tmdi.existingMounts.push_back(ExistingMount());
tmdi.existingMounts.back().type = d->mountType;
tmdi.existingMounts.back().tapePool = d->currentTapePool;
tmdi.existingMounts.back().driveName = d->name;
}
}
std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo> ret(std::move(privateRet));
......
......@@ -353,11 +353,14 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(const std::string &
// with the per tape pool existing mount statistics.
typedef std::pair<std::string, cta::MountType::Enum> tpType;
std::map<tpType, uint32_t> existingMountsSummary;
for (auto em=mountInfo->existingMounts.begin(); em!=mountInfo->existingMounts.end(); em++) {
try {
existingMountsSummary.at(tpType(em->tapePool, em->type))++;
} catch (std::out_of_range &) {
existingMountsSummary[tpType(em->tapePool, em->type)] = 1;
for (auto & em: mountInfo->existingMounts) {
// If a mount is still listed for our own drive, it is a leftover that we disregard.
if (em.driveName!=driveName) {
try {
existingMountsSummary.at(tpType(em.tapePool, em.type))++;
} catch (std::out_of_range &) {
existingMountsSummary[tpType(em.tapePool, em.type)] = 1;
}
}
}
......
......@@ -366,6 +366,7 @@ public:
* Information about the existing mounts.
*/
struct ExistingMount {
std::string driveName;
cta::MountType::Enum type;
std::string tapePool;
};
......
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