Skip to content

Commit f20dcd7

Browse files
committed
stop run if first RDH is wrong
1 parent fe17bf6 commit f20dcd7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

doc/releaseNotes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ This file describes the main feature changes for each readout.exe released versi
531531
- Disabled unused RDMA features (still available by switch in CMake)
532532
- Added feature for memory banks real time monitoring. Enabled by setting membanksMonitorRate in /etc/o2.d/readout-defaults.cfg. Output (high-rate text) can be seen locally in real time with `tail -f /tmp/readout-monitor-mempool-(id)`. The status of each page in the bank is displayed.
533533

534-
## v2.17.2 - 08/03/2023
534+
s## v2.17.2 - 08/03/2023
535535
- Updated naming of files saved to disk when equipment-*.saveErrorPagesMax is set. Now includes timestamp, equipment id, and file counter: e.g. /tmp/readout-t1678288819-eq1-superpage.1.raw
536536

537537
## v2.18.0 - 21/03/2023
@@ -606,3 +606,6 @@ This file describes the main feature changes for each readout.exe released versi
606606

607607
## v2.21.8 - 29/11/2023
608608
- Fixed spurious readout warning("TF non-contiguous ordering") when doing Start/Stop/Start with DD is enabled.
609+
610+
## next version
611+
- When equipment-*-rdhCheckFirstOrbit is set (default), the run is stopped if the first RDH received for an equipment does not passes validation, as in the case when first orbits mismatch.

src/ReadoutEquipment.cxx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,17 @@ Thread::CallbackResult ReadoutEquipment::threadCallback(void* arg)
438438
}
439439
updatePageStateFromDataBlockContainerReference(nextBlock, MemoryPage::PageState::InEquipment);
440440

441+
// here some test code to artifically corrupt RDH of block X of equipment id Y
442+
// used to test error conditions, eg first RDH received is wrong
443+
/*
444+
int X=1;
445+
int Y=33;
446+
if ((ptr->currentBlockId==X)&&(ptr->id==Y)) {
447+
o2::Header::RAWDataHeader* h = (o2::Header::RAWDataHeader*) nextBlock->getData()->data;
448+
h->version=99;
449+
}
450+
*/
451+
441452
// handle RDH-formatted data
442453
if (ptr->cfgRdhUseFirstInPageEnabled) {
443454
if ((ptr->processRdh(nextBlock)) && ptr->cfgDropPagesWithError) {
@@ -852,6 +863,12 @@ int ReadoutEquipment::processRdh(DataBlockContainerReference& block)
852863

853864
if (tagDatablockFromRdh(h, blockHeader) == 0) {
854865
blockHeader.isRdhFormat = 1;
866+
} else {
867+
if ((cfgRdhCheckFirstOrbit) && (currentBlockId == 0)) {
868+
// if 1st RDH received is wrong, it's the same as a wrong orbit
869+
theLog.log(LogErrorSupport_(3241), "Equipment %s : first RDH is wrong", name.c_str());
870+
isFatalError++;
871+
}
855872
}
856873

857874
if (cfgRdhDumpFirstInPageEnabled) {

0 commit comments

Comments
 (0)