Skip to content

Skip invalid timeframes during ROOT input - #15576

Open
autumn-mck wants to merge 13 commits into
AliceO2Group:devfrom
autumn-mck:fault-tolerence
Open

Skip invalid timeframes during ROOT input#15576
autumn-mck wants to merge 13 commits into
AliceO2Group:devfrom
autumn-mck:fault-tolerence

Conversation

@autumn-mck

Copy link
Copy Markdown
Contributor

Handle corrupt reads as recoverable, discarding the timeframe

@ktf

ktf commented Jul 6, 2026

Copy link
Copy Markdown
Member

thank you for your contribution. somehow i did not get notified about this. i will have a look at it tomorrow, time permitting. One comment i already have is that you can probably split the changes to LifetimeHolder as a separate PR.

Comment thread Framework/Core/include/Framework/DataAllocator.h Outdated
Comment thread Framework/AnalysisSupport/src/TTreePlugin.cxx
@autumn-mck
autumn-mck marked this pull request as ready for review August 3, 2026 13:30
@autumn-mck
autumn-mck requested a review from a team as a code owner August 3, 2026 13:30
@ktf

ktf commented Aug 3, 2026

Copy link
Copy Markdown
Member

The part about the MessageContext can also be merged separately. Can you spawn a new PR?

@jgrosseo

jgrosseo commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@ktf Do you have other comments apart from the splitting?

@ktf

ktf commented Aug 4, 2026

Copy link
Copy Markdown
Member

I did not look into the details of the rest. I will do once I am back, tomorrow.

@ktf

ktf commented Aug 4, 2026

Copy link
Copy Markdown
Member

We should also think how to test this, e.g. making sure it actually does not get stuck or silently skips stuff.

@jgrosseo

jgrosseo commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

We should also think how to test this, e.g. making sure it actually does not get stuck or silently skips stuff.

Once we can enable it by environment variable, we plan to clone some trains which had large number of failures, enable the feature only for those, and do a detailed inspection of the logs and output.

@alibuild

alibuild commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 39c7515 at 2026-08-05 03:44:

## sw/BUILD/O2-latest/log
CMake Error in Detectors/Base/CMakeLists.txt:

Full log here.

Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
if (!treeRead) {
if (!first) {
LOGP(fatal, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin.as<std::string>(), fcnt, ntf);
throw std::runtime_error("Processing is stopped!");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually trigger? I suspect this is old dead code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is it can still trigger if a later requested table uses a separate DataInputDescriptor whose file has fewer timeframes than the first table’s file, but for the normal case this is effectively unreachable. Should this be removed?

Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
};
auto readState = TFReaderState::READ_FIRST_TABLE;
size_t routeIndex = 0;
while (readState == TFReaderState::READ_FIRST_TABLE ||

@ktf ktf Aug 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I find this still hard to read / understand. I would have expected the state machine to work as follows:

while(!exitStates(state))
{
case STATE: {
   // Perform operations for state
  state = NEXT_STATE;
} break;
case STATE2: {
} break;
// etc.
}

while here it's all a bit intermixed. Am I missing any particular corner case which makes this complicated, hence the current approach?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a change now to try clarify and separate this

MetricSpec{.name = "dropped_computations", .metricId = static_cast<short>(ProcessingStatsId::DROPPED_COMPUTATIONS), .kind = Kind::UInt64, .minPublishInterval = quickUpdateInterval},
MetricSpec{.name = "dropped_incoming_messages", .metricId = static_cast<short>(ProcessingStatsId::DROPPED_INCOMING_MESSAGES), .kind = Kind::UInt64, .minPublishInterval = quickUpdateInterval},
MetricSpec{.name = "relayed_messages", .metricId = static_cast<short>(ProcessingStatsId::RELAYED_MESSAGES), .kind = Kind::UInt64, .minPublishInterval = quickUpdateInterval},
MetricSpec{.name = "aod-invalid-read-skipped-timeframes",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra metric can go in even without the rest of the code, if you want.

Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
Comment thread Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx Outdated
int level = originLevelMapping.empty() ? -1 : 0;
auto fileCounter = std::make_shared<int>(0);
auto numTF = std::make_shared<int>(-1);
bool const skipInvalidReads = [] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be a static function, no?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, didn't you have some more complete logic for it? what happened to it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There wasn't a more complete logic than this, I've also checked force pushed I made previously to make sure. What way should this better be handled?

try {
f2b->fill(datasetSchema, format);
} catch (std::exception const& e) {
f2b.discard();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe all the exception handling you are doing should be rewritten using std::experimental::scoped_exit (which our compiler requirements support) and std::throw_nested_exception .

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 0b77c70 at 2026-08-17 17:56:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@jgrosseo

Copy link
Copy Markdown
Collaborator

@ktf We just discussed and think it's best we do the parent file exception implementation later. In a first step we will test this feature only on demand on certain datasets on Hyperloop and we can start testing with non-parent file datasets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants