[IO] Honor READ_WITHOUT_GLOBALREGISTRATION in TNetXNGFile#11321
[IO] Honor READ_WITHOUT_GLOBALREGISTRATION in TNetXNGFile#11321eguiraud merged 3 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
net/netxng/src/TNetXNGFile.cxx
Outdated
| TNetXNGFile::TNetXNGFile(const char *url, const char *lurl, Option_t *mode, const char *title, Int_t compress, | ||
| Int_t /*netopt*/, Bool_t parallelopen) | ||
| : TFile((lurl ? lurl : url), | ||
| strcmp(mode, "READ_WITHOUT_GLOBALREGISTRATION") == 0 ? "NET_WITHOUT_GLOBALREGISTRATION" : "NET", title, |
There was a problem hiding this comment.
| strcmp(mode, "READ_WITHOUT_GLOBALREGISTRATION") == 0 ? "NET_WITHOUT_GLOBALREGISTRATION" : "NET", title, | |
| strstr(mode, "_WITHOUT_GLOBALREGISTRATION") != nullptr ? "NET_WITHOUT_GLOBALREGISTRATION" : "NET", title, |
would allow to seamlessly support the other opening type.
There was a problem hiding this comment.
what other opening type? NET_WITHOUT_GLOBALREGISTRATION is not available to client code, it's just for internal use (and it's not documented anywhere). the documented option is only READ_WITHOUT_GLOBALREGISTRATION. I think it's simpler this way? (also considering the behavior before this patch)
There was a problem hiding this comment.
With the change on line 364 and related, we now support (even if not documented yet) all combination of opening type and _WITHOUT_GLOBALREGISTRATION, including RECREATE_WITHOUT_GLOBALREGISTRATION, UPDATE_WITHOUT_GLOBALREGISTRATION etc. And I think this is a good thing (and should be documented of course :) ).
And without the proposed, change we keep at supporting 'only' READ_WITHOUT_GLOBALREGISTRATION for 'only' theNET/WEB case.
There was a problem hiding this comment.
adding support for RECREATE_WITHOUT_GLOBALREGISTRATION etc., adding documentation for them and the corresponding tests is beyond the scope of this PR. The intent is just to fix #10742 .
There was a problem hiding this comment.
But to be consistent, you would have to add code to explicitly reject the new supported mode; where as extending is 'simply' using the strstr and extending the doc which is currently bare:
204:/// READ_WITHOUT_GLOBALREGISTRATION | Used by TTreeProcessorMT, not a user callable option.
and could simply be as bare:
204:/// [READ|NEW|UPDATE|RECREATE]_WITHOUT_GLOBALREGISTRATION | Used by TTreeProcessorMT, not a user callable option.
There was a problem hiding this comment.
eg. TTreeProcessorMT could use RECREATE_WITHOUT_GLOBALREGISTRATION for Snapshot output file.
There was a problem hiding this comment.
to be consistent, you would have to add code to explicitly reject the new supported mode
That's not the behavior anywhere in TFile:
$ root -l
root [0] TFile::Open("f.root", "alskjdalksjd")
(TFile *) 0x559fa18d0200
root [1] TFile::Open("root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod_skimmed/ZZTo4mu.root", "alsjalsjdalsdjka")
(TFile *) 0x555fc11ba680I just picked up #10742 although it was not assigned to me because that specific issue is problematic for RDF. Adding new features to TFile that were not requested or discussed before can be done in a different PR, and it does not seem reasonable to me to request them from me in the context of a bug fix.
With that said, I applied your suggestion in the original comment so it will be easier to extend this in the future.
|
Using the file (possibly separating all 3 failures types). |
4dcae88 to
a4630cc
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests: |
|
Build failed on ROOT-ubuntu2004/python3. Failing tests: |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Failing tests: |
|
Build failed on ROOT-debian10-i386/soversion. Failing tests: |
|
Build failed on mac11/cxx14. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
Build failed on mac1015/cxx17. Failing tests: |
|
The problem with the test is that on those platforms |
...as well as in TNetFile, TDavixFile and TWebFile. This fixes root-project#10742.
a4630cc to
a35c5c7
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
Build failed on mac11/cxx14. Failing tests: |
It might work on more platforms. Co-authored-by: Philippe Canal <[email protected]>
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests: |
|
Build failed on mac11/cxx14. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
Build failed on mac1015/cxx17. Failing tests: |
|
The failures are unrelated. |
...as well as in TNetFile and TWebFile.
This fixes #10742.
@pcanal can you please suggest a test?