Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue exception for ROOT file forward incompatiblity problem #43894

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions FWCore/ParameterSet/src/Entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ namespace edm {
}
default: {
// We should never get here.
assert("Invalid type code" == nullptr);
//throw EntryError(std::string("invalid type code ") + type);
throw edm::Exception(edm::errors::Configuration) << "Unknown ParameterSet Entry type encoding: '" << type_
<< "'.\n This could be caused by reading a file which was "
"written using a newer incompatible software release.";
break;
}
} // switch(type)
Expand Down
23 changes: 17 additions & 6 deletions IOPool/Input/src/RootFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,23 @@ namespace edm {
} else {
// Merge into the parameter set registry.
pset::Registry& psetRegistry = *pset::Registry::instance();
for (auto const& psetEntry : psetMap) {
ParameterSet pset(psetEntry.second.pset());
pset.setID(psetEntry.first);
// For thread safety, don't update global registries when a secondary source opens a file.
if (inputType != InputType::SecondarySource) {
psetRegistry.insertMapped(pset);
try {
for (auto const& psetEntry : psetMap) {
ParameterSet pset(psetEntry.second.pset());
pset.setID(psetEntry.first);
// For thread safety, don't update global registries when a secondary source opens a file.
if (inputType != InputType::SecondarySource) {
psetRegistry.insertMapped(pset);
}
}
} catch (edm::Exception const& iExcept) {
if (iExcept.categoryCode() == edm::errors::Configuration) {
edm::Exception exception(edm::errors::FormatIncompatibility);
exception << iExcept.message();
exception.addContext("Creating ParameterSets from file");
throw exception;
} else {
throw;
}
}
}
Expand Down