Opt-in graceful corruption handling in StraxFormatter with deadtime markers#105
Open
cfuselli wants to merge 3 commits into
Open
Opt-in graceful corruption handling in StraxFormatter with deadtime markers#105cfuselli wants to merge 3 commits into
cfuselli wants to merge 3 commits into
Conversation
2356d65 to
8022743
Compare
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
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.
Graceful corruption handling in
StraxFormatter+ optional deadtime markersWhy
We are seeing DAQ failures where malformed/incomplete payloads propagate into the formatter path and can crash readout.
This PR adds an opt-in path to keep readout alive when corruption is detected, while explicitly marking affected periods via artificial deadtime.
This is intended as a mitigation for commissioning/debugging while CAEN-side root cause analysis continues.
Context from history
GenerateArtificialDeadtime(...)was intentionally disabled on board-fail events in commita6a5387("Disable artificial deadtime until it gets fixed").This PR re-introduces deadtime insertion in a guarded, configurable way and adds stricter parser guards.
What changes
1) New runtime flags (default-safe)
In
StraxFormatter:graceful_corruption_handling(default0)0: preserve current fail-fast behavior1: catch corruption/parsing exceptions per datapacket, log, continueinject_deadtime_on_corrupt(default1)2) Corruption guard checks
Added explicit validation before potentially unsafe operations:
>= event_header_words)remove_prefix3) Graceful handler
New helper:
HandleCorruptPacket(...)4) Processing loop behavior
In
Process():ProcessDatapacket(...)in try/catch5) Board-fail path
On event
failbit, deadtime insertion is re-enabled behind config flaginject_deadtime_on_corrupt.Files changed
StraxFormatter.ccStraxFormatter.hhBehavior / compatibility
graceful_corruption_handling=0).straxencode changes: channel 799 and veto propagation already exist.Risks / caveats
Validation performed
libmongocxx, local toolchain mismatch).Suggested rollout
graceful_corruption_handling = 1inject_deadtime_on_corrupt = 1straxen_deadtime_vetointervals in downstream data qualityFollow-ups (recommended)