-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[6.34] Backports for ATLAS FastFrames framework #17798
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
Merged
vepadulano
merged 5 commits into
root-project:v6-34-00-patches
from
vepadulano:tfile-open-eos-fallback-v634
Mar 5, 2025
Merged
[6.34] Backports for ATLAS FastFrames framework #17798
vepadulano
merged 5 commits into
root-project:v6-34-00-patches
from
vepadulano:tfile-open-eos-fallback-v634
Mar 5, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes the `getxattr` call returns a valid string, but the string is incomplete. Namely, part of the full URL to the file on EOS is missing (usually the filename itself). Workaround by checking that the xurl string ends with the filename and in case it is not present, avoid calling TFile::Open. Co-authored-by: Jonas Hahnfeld <[email protected]>
dpiparo
approved these changes
Feb 21, 2025
Test Results 19 files 19 suites 4d 6h 38m 47s ⏱️ Results for commit 8c05b8c. ♻️ This comment has been updated with latest results. |
When the input files are paths to FUSE-mounted EOS files, during the event loop these paths will be redirected to the corresponding xroot EOS URL, in TFile::Open. This was causing a bad interaction with the sample metadata and the subsequent usage in the event loop, e.g. through DefinePerSample. Specifically, we fill a map with the metadata at construction time, which includes the input file paths (without redirection). These will then be irretrievable during the event loop since the map key will not correspond to the redirected path. Fix this by also adding the redirected map during the filling of the map in ChangeSpec.
24f0c29 to
8158b40
Compare
Fixes root-project#17820 Full analysis of the issue follows: 1. TChain::GetEntries calls TChain::LoadTree(TTree::kMaxEntries - 1) 2. Internally, this will set fReadEntry == -2, due to how LoadTree works and the fact it's trying to read beyond the last entry in the chain 3. This has an effect here https://github.com/root-project/root/blob/f33985dca2d6bc505e83498f7b4561ddd969be17/tree/tree/src/TChain.cxx#L1675-L1679 where `t` is the current friend being traversed in the list of friends of the *chain*. We call `t->LoadTree(TTree::kMaxEntries - 1)`. 4. Inside the call to LoadTree on the friend, we reach this line https://github.com/root-project/root/blob/f33985dca2d6bc505e83498f7b4561ddd969be17/tree/tree/src/TChain.cxx#L1484 where the fTree data member of the friend is invalidated. 5. Back to the LoadTree of the main chain, these lines https://github.com/root-project/root/blob/f33985dca2d6bc505e83498f7b4561ddd969be17/tree/tree/src/TChain.cxx#L1681-L1684 would normally connect the fTree data member of the main chain to the current friend, so the list of friends is properly populated. But due to 4., `friend->GetTree()` will return nullptr so the connection won't happen. This commit changes the implementation of TChain::GetEntries, so that after computing the total number of entries the chain is brought back to an invalid but recoverable state, and if the previous read entry was at least zero, the cursor is moved to it. Co-authored-by: Philippe Canal <[email protected]>
Avoid calling LoadTree when it will be a no-op and especially don't undo work we wont be able to redo
Calling GetEntriesFast is enough to know if you reach past the end (if we are in the last file then it will return the precise number or something too large if we are far). Calling GetEntries can move the cursor of the chain and thus change the state of the parent.
00afa9b
into
root-project:v6-34-00-patches
41 of 42 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #16173, #17544 and #17822 as needed by ATLAS, see 177th PPP meeting