Skip to content

Commit ad03f8b

Browse files
authored
Merge pull request cms-sw#33798 from ggovi/conddb-PoolDBESSource-fix-for-deleted-records-1-120X
GT Initialization: ignoring non-existing record in the plugins pre-load
2 parents 7cdba48 + 73a4013 commit ad03f8b

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

CondCore/ESSources/plugins/CondDBESSource.cc

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,12 @@ CondDBESSource::CondDBESSource(const edm::ParameterSet& iConfig)
231231
std::vector<std::unique_ptr<cond::DataProxyWrapperBase>> proxyWrappers(m_tagCollection.size());
232232
size_t ipb = 0;
233233
for (it = itBeg; it != itEnd; ++it) {
234-
proxyWrappers[ipb++] = std::unique_ptr<cond::DataProxyWrapperBase>{
235-
cond::ProxyFactory::get()->create(buildName(it->second.recordName()))};
234+
size_t ind = ipb++;
235+
proxyWrappers[ind] = std::unique_ptr<cond::DataProxyWrapperBase>{
236+
cond::ProxyFactory::get()->tryToCreate(buildName(it->second.recordName()))};
237+
if (!proxyWrappers[ind].get()) {
238+
edm::LogWarning("CondDBESSource") << "Plugin for Record " << it->second.recordName() << " has not been found.";
239+
}
236240
}
237241

238242
// now all required libraries have been loaded
@@ -267,17 +271,19 @@ CondDBESSource::CondDBESSource(const edm::ParameterSet& iConfig)
267271
// ownership...
268272
ProxyP proxy(std::move(proxyWrappers[ipb++]));
269273
// instert in the map
270-
m_proxies.insert(std::make_pair(it->second.recordName(), proxy));
271-
// initialize
272-
boost::posix_time::ptime tagSnapshotTime = snapshotTime;
273-
auto tagSnapshotIter = specialSnapshots.find(it->first);
274-
if (tagSnapshotIter != specialSnapshots.end())
275-
tagSnapshotTime = tagSnapshotIter->second;
276-
// finally, if the snapshot is set to infinity, reset the snapshot to null, to take the full iov set...
277-
if (tagSnapshotTime == boost::posix_time::time_from_string(std::string(cond::time::MAX_TIMESTAMP)))
278-
tagSnapshotTime = boost::posix_time::ptime();
279-
280-
proxy->lateInit(nsess, tag, tagSnapshotTime, it->second.recordLabel(), connStr, &m_queue, &m_mutex);
274+
if (proxy.get()) {
275+
m_proxies.insert(std::make_pair(it->second.recordName(), proxy));
276+
// initialize
277+
boost::posix_time::ptime tagSnapshotTime = snapshotTime;
278+
auto tagSnapshotIter = specialSnapshots.find(it->first);
279+
if (tagSnapshotIter != specialSnapshots.end())
280+
tagSnapshotTime = tagSnapshotIter->second;
281+
// finally, if the snapshot is set to infinity, reset the snapshot to null, to take the full iov set...
282+
if (tagSnapshotTime == boost::posix_time::time_from_string(std::string(cond::time::MAX_TIMESTAMP)))
283+
tagSnapshotTime = boost::posix_time::ptime();
284+
285+
proxy->lateInit(nsess, tag, tagSnapshotTime, it->second.recordLabel(), connStr, &m_queue, &m_mutex);
286+
}
281287
}
282288

283289
// one loaded expose all other tags to the Proxy!

0 commit comments

Comments
 (0)