Skip to content
Open
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
18 changes: 18 additions & 0 deletions Framework/AODMerger/src/aodValidator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ int validate(const char* url, bool deep, int maxReports)
printf("BAD %s/%s: %s\n", df, tree, what.c_str());
}
};
// A read which failed because the connection to the storage was lost leaves
// the file closed: the rest of the file cannot be checked, which is not damage.
auto lost = [&]() {
if (file->IsOpen()) {
return false;
}
printf("ERROR: lost the connection to %s after %d DFs\n", url, dfs);
return true;
};
if (file->TestBit(TFile::kRecovered)) {
report("", "", "the file was not closed: ROOT recovered its keys, the DF folders may be empty");
}
Expand All @@ -65,6 +74,9 @@ int validate(const char* url, bool deep, int maxReports)
++dfs;
std::unique_ptr<TDirectory> dir((TDirectory*)key->ReadObj());
if (!dir) {
if (lost()) {
return -1;
}
report(key->GetName(), "", "cannot read the folder");
continue;
}
Expand All @@ -75,6 +87,9 @@ int validate(const char* url, bool deep, int maxReports)
}
std::unique_ptr<TTree> tree((TTree*)treeKey->ReadObj());
if (!tree) {
if (lost()) {
return -1;
}
report(key->GetName(), treeKey->GetName(), "cannot read the tree");
continue;
}
Expand All @@ -97,6 +112,9 @@ int validate(const char* url, bool deep, int maxReports)
if (deep) {
char buffer[256];
if (file->ReadBuffer(buffer, seek, std::min<Long64_t>(sizeof(buffer), size - seek))) {
if (lost()) {
return -1;
}
report(key->GetName(), tree->GetName(), Form("branch %s basket %d: cannot read its key at %lld", br->GetName(), b, seek));
continue;
}
Expand Down