From fb8e853471243fa269f769daa341b2db5f81c9fb Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 24 Mar 2025 13:26:00 +0100 Subject: [PATCH] DPL: Print error in case we receive data with bogus runNumber / tfCounter --- Framework/Core/src/ExternalFairMQDeviceProxy.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx index 823ef8f5fd5a0..52e0413d48dab 100644 --- a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx +++ b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx @@ -493,6 +493,12 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, DPL } } + int fmqRunNumber = -1; + try { + fmqRunNumber = atoi(device->fConfig->GetProperty("runNumber", "").c_str()); + } catch (...) { + } + for (int msgidx = 0; msgidx < parts.Size(); msgidx += 2) { if (parts.At(msgidx).get() == nullptr) { LOG(error) << "unexpected nullptr found. Skipping message pair."; @@ -521,6 +527,9 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, DPL timingInfo.runNumber = dh->runNumber; timingInfo.tfCounter = dh->tfCounter; LOG(debug) << msgidx << ": " << DataSpecUtils::describe(OutputSpec{dh->dataOrigin, dh->dataDescription, dh->subSpecification}) << " part " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts << " payload " << parts.At(msgidx + 1)->GetSize(); + if (dh->runNumber == 0 || dh->tfCounter == 0 || (fmqRunNumber > 0 && fmqRunNumber != dh->runNumber)) { + LOG(error) << "INVALID runNumber / tfCounter: runNumber " << dh->runNumber << ", tfCounter " << dh->tfCounter << ", FMQ runNumber " << fmqRunNumber; + } OutputSpec query{dh->dataOrigin, dh->dataDescription, dh->subSpecification}; LOG(debug) << "processing " << DataSpecUtils::describe(OutputSpec{dh->dataOrigin, dh->dataDescription, dh->subSpecification}) << " time slice " << dph->startTime << " part " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts;