Commit 3b21a6f2 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed reference to object (backendPopulator) being used in longer lived object(OStoreDBWithAgent).

parent 715e5302
......@@ -106,6 +106,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
}
// 2b) Get initial mount information
std::unique_ptr<cta::TapeMount> tapeMount;
schedule:
try {
tapeMount.reset(m_scheduler.getNextMount(m_driveConfig.getLogicalLibrary(), m_driveConfig.getUnitName()).release());
} catch (cta::exception::Exception & e) {
......@@ -117,9 +118,11 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
}
// No mount to be done found, that was fast...
if (!tapeMount.get()) {
lc.log(cta::log::INFO, "No new mount found!");
lc.log(cta::log::DEBUG, "No new mount found. (sleeping 10 seconds)");
m_scheduler.reportDriveStatus(m_driveInfo, cta::common::dataStructures::MountType::NoMount, cta::common::dataStructures::DriveStatus::Up);
return MARK_DRIVE_AS_UP;
sleep (10);
goto schedule;
// return MARK_DRIVE_AS_UP;
}
m_volInfo.vid=tapeMount->getVid();
m_volInfo.mountType=tapeMount->getMountType();
......
......@@ -848,10 +848,11 @@ int DriveHandler::runChild() {
} catch (std::bad_cast &){}
// Create the agent entry in the object store. This could fail (even before ping, so
// handle failure like a ping failure).
std::unique_ptr<cta::objectstore::BackendPopulator> backendPopulator;
std::unique_ptr<cta::OStoreDBWithAgent> osdb;
try {
cta::objectstore::BackendPopulator backendPopulator(*backend);
osdb.reset(new cta::OStoreDBWithAgent(*backend, backendPopulator.getAgentReference()));
backendPopulator.reset(new cta::objectstore::BackendPopulator(*backend));
osdb.reset(new cta::OStoreDBWithAgent(*backend, backendPopulator->getAgentReference()));
} catch(cta::exception::Exception &ex) {
log::ScopedParamContainer param(m_processManager.logContext());
param.add("errorMessage", ex.getMessageValue());
......
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