Skip to content

[DF] Cannot read files that don't have a .root extension with IMT on #8739

@eguiraud

Description

@eguiraud

Reproducer:

#include <ROOT/RDataFrame.hxx>
#include <iostream>

int main() {
  ROOT::RDataFrame(10)
      .Define("x", [] { return 42; })
      .Snapshot<int>("t", "thefile", {"x"});
  std::cout << "done writing\n";

  ROOT::EnableImplicitMT();
  ROOT::RDataFrame("t", "thefile").Max<int>("x").GetValue();

  return 0;
}

prints

done writing
Error in <TFile::TFile>: file /tmp/thefile/t does not exist
Warning in <TTreeReader::SetEntryBase()>: There was an issue opening the last file associated to the TChain being processed.

This is likely due to logic in TChain::AddFile that expects a .root extension to be present in order to distinguish /path/to/file.root/treename from just /path/to/file.root (over the network or via xrootd it's difficult/expensive to figure out which case we are in otherwise).

Additional context

First reported at https://root-forum.cern.ch/t/getting-value-from-tbranch-is-extremely-slow/45950

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions