Skip to content

Commit b6ad4bc

Browse files
committed
DPL: Print error in case we receive data with bogus runNumber / tfCounter
1 parent e836e3f commit b6ad4bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Framework/Core/src/ExternalFairMQDeviceProxy.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ InjectorFunction dplModelAdaptor(std::vector<OutputSpec> const& filterSpecs, DPL
493493
}
494494
}
495495

496+
int fmqRunNumber = -1;
497+
try {
498+
fmqRunNumber = atoi(device->fConfig->GetProperty<std::string>("runNumber", "").c_str());
499+
} catch (...) {
500+
}
501+
496502
for (int msgidx = 0; msgidx < parts.Size(); msgidx += 2) {
497503
if (parts.At(msgidx).get() == nullptr) {
498504
LOG(error) << "unexpected nullptr found. Skipping message pair.";
@@ -521,6 +527,9 @@ InjectorFunction dplModelAdaptor(std::vector<OutputSpec> const& filterSpecs, DPL
521527
timingInfo.runNumber = dh->runNumber;
522528
timingInfo.tfCounter = dh->tfCounter;
523529
LOG(debug) << msgidx << ": " << DataSpecUtils::describe(OutputSpec{dh->dataOrigin, dh->dataDescription, dh->subSpecification}) << " part " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts << " payload " << parts.At(msgidx + 1)->GetSize();
530+
if (dh->runNumber == 0 || dh->tfCounter == 0 || (fmqRunNumber > 0 && fmqRunNumber != dh->runNumber)) {
531+
LOG(error) << "INVALID runNumber / tfCounter: runNumber " << dh->runNumber << ", tfCounter " << dh->tfCounter << ", FMQ runNumber " << fmqRunNumber;
532+
}
524533

525534
OutputSpec query{dh->dataOrigin, dh->dataDescription, dh->subSpecification};
526535
LOG(debug) << "processing " << DataSpecUtils::describe(OutputSpec{dh->dataOrigin, dh->dataDescription, dh->subSpecification}) << " time slice " << dph->startTime << " part " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts;

0 commit comments

Comments
 (0)