Skip to content

READ_WITHOUT_GLOBALREGISTRATION has no effect on remote files #10742

@eguiraud

Description

@eguiraud

This

#include <TFile.h>
#include <TROOT.h>

void foo() {
   // works
   auto *f2 = TFile::Open("~/Scratchpad/work/UnROOT_RDataFrame_MiniBenchmark/Run2012BC_DoubleMuParked_Muons.root", "READ_WITHOUT_GLOBALREGISTRATION");
   gROOT->GetListOfFiles()->Print();

   // doesn't work
   auto *f = TFile::Open("root://eospublic.cern.ch//eos/opendata/cms/derived-data/AOD2NanoAODOutreachTool/Run2012BC_DoubleMuParked_Muons.root", "READ_WITHOUT_GLOBALREGISTRATION");
   gROOT->GetListOfFiles()->Print();
}

yields

Processing foo.cpp...
Collection name='Files', class='TList', size=0 // OK
Collection name='Files', class='TList', size=1 // KO
 TFile: name=root://eospublic.cern.ch//eos/opendata/cms/derived-data/AOD2NanoAODOutreachTool/Run2012BC_DoubleMuParked_Muons.root, title=, option=READ

i.e. the READ_WITHOUT_GLOBALREGISTRATION is ignored when using TFile::Open to read a file via xrootd.

This might lead to unexpected performance degradation as well as use-after-deletes in some cases (e.g. a TChain with kWithoutGlobalRegistration uses TFile::Open to read a remote file, loads a tree (which will have the kMustCleanup bit reset by the TChain), then if the global list of files is cleaned before the TChain is destroyed the chain will have a dangling pointer to its fFile and fTree).

This is likely not just an issue with xrootd files but all TFile implementations except the local.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions