Skip to content

Conversation

@bbockelm
Copy link
Collaborator

XrdHttp relies on a flag set by XrdXrootd indicating that the file being stat'd is cached. In turn, the stat flag is only set if the SFS layer claims to have the "cache" feature.

It turns out that the XrdThrottle class treated the Features() function as if it was an overrided virtual when instead it was a non-virtual method in the base class with the following implementation:

uint64_t       Features() {return FeatureSet;}

where FeatureSet is a protected member.

So, the features reported when the throttle is installed are just some defaults, not the actual features of the object it wraps.

The impact of the bug is the Age header is never set for caches with the throttle installed. It was picked up by the Pelican integration tests when an upgrade to v5.8.0 was attempted.

The fix for the bug sets the FeatureSet member inside the Throttle object based on the value returned by the object it wraps. To prevent future recurrences where a virtual function looks like it is overriding when it does not, I also added the proper annotations to the throttle header file.

I would suggest considering making the Features() function virtual in R6.

The type definition of the throttle class makes it appear as if the
`Features` function is a virtual that can be forwarded along; this
is not true.  Instead, it's defined in the base and accesses a
protected member.  That must be copied forward to have the right
features reported.

This was noticed when a throttle plugin was run on top of a cache:
the cache bit got dropped, causing the `Age` header to go missing.
The `Features()` function was implemented as if it was an override
but it is not a virtual function in the base class; this caused a
real bug in the combination of the Throttle and Pfc.

Markup the throttle class with overrides to prevent such a bug
from recurring.
@bbockelm bbockelm added the Pelican Pelican Platform — https://pelicanplatform.org/ label Apr 13, 2025
@amadio amadio merged commit 9af46b2 into xrootd:master Apr 14, 2025
20 of 21 checks passed
@amadio amadio added this to the 5.8.1 milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pelican Pelican Platform — https://pelicanplatform.org/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants