Description
Check duplicate issues.
- Checked for duplicates
Description
Consider the following tree loading structure:
TChain c2 ---> TTree ---(friend)---> TChain c1 ---> TTree
When iterating over c2
, branches coming from c1
stop updating after the first file boundary is reached in c1
. They start updating again once a file boundary is reached in c2
.
I think this is distinct from #16804 because in this case the issues lie in TChain::LoadTree
, while for #16804 TChain::LoadTree
is the sole culprit.
As in #16804, the root cause of the issue is that the following code is not invoked often enough:
Lines 1407 to 1434 in 2cc4b70
I will call the operation above an "address refresh".
TChain has code triggering an address refresh when needed for friends of the current tree:
Lines 1384 to 1393 in 2cc4b70
Unfortunately this doesn't work for two reasons:
- The code cannot possibly be reached unless
c2
itself has friends because of the following condition:
Line 1370 in 2cc4b70
In our casec2
doesn't have friends, but thefTree
does. This is easy to fix (or work around). - Even if
fFriends
is made non-null,fetree->IsUpdated()
always returnsfalse
becauseTTree::LoadTree
resets it:
Line 6512 in 18b4f31
Fixing this is much more annoying. For my application, I ended up subscribing to theNotify
signal and callingTFriendElement::MarkUpdated
again. This is only a partial solution because whenc2
loads a new file, it doesn't reset friend elements that were marked updated, which would happen somewhere along this line:
Line 1666 in 2cc4b70
Reproducer
Rename to recursiveBugDemo.C
and run the following macro: recursiveBugDemo.txt
It works similarly to #16804 and should only print true
.
ROOT version
Seen in:
- ROOT 6.30/04 (anaconda)
- ROOT 6.28/04 (LCG 104)
I couldn't find any code change in master in the relevant areas.
Installation method
anaconda and LCG 104
Operating system
Linux (CentOS 9, Ubuntu 22.04, Ubuntu 24.04)
Additional context
No response