Skip to content

RootUtils: Delay setting root error handler.

Scott Snyder requested to merge ssnyder/athena:errhand.RootUtils-20240510 into main

The ROOT error handler used by WithRootErrorHandler was being set when the RootUtils library was loaded. However, that may be too early; in particular, the ATLAS RNTuple code sets a temporary error handler.

Change to setting the handler the first time WithRootErrorHandler gets called.

By the time we're called, there may be multiple threads running, so it is in principle not safe to call SetErrorHandler. However, there shouldn't be anything else in Athena calling it, so in practice it should be ok. As an extra check, we abort if the handler we get back isn't what we set, indicating a potential race.

See ATLASRECTS-7967.

Merge request reports