From fba5f6d548b1ce599bd990e825568ec56c11ce28 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:45:27 +0200 Subject: [PATCH] Make sure we notify DPL about non-DPL message sending This is needed to avoid skipping CCDB callbacks on the last timeframe. --- Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx | 4 ++++ Framework/Core/include/Framework/MessageContext.h | 1 + 2 files changed, 5 insertions(+) diff --git a/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx b/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx index 9a16e6622bcbf..a75254c490c6a 100644 --- a/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx +++ b/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx @@ -264,6 +264,10 @@ void TFReaderSpec::run(o2f::ProcessingContext& ctx) nparts += msgIt.second->Size() / 2; device->Send(*msgIt.second.get(), msgIt.first); } + // FIXME: this is to pretend we did send some messages via DPL. + // we should really migrate everything to use FairMQDeviceProxy, + // however this is a small enough hack for now. + ctx.services().get().fakeDispatch(); tNow = std::chrono::time_point_cast(std::chrono::system_clock::now()).time_since_epoch().count(); deltaSending = mTFCounter ? tNow - tLastTF : 0; LOGP(info, "Sent TF {} of size {} with {} parts, {:.4f} s elapsed from previous TF.", mTFCounter, dataSize, nparts, double(deltaSending) * 1e-6); diff --git a/Framework/Core/include/Framework/MessageContext.h b/Framework/Core/include/Framework/MessageContext.h index 6d027da1ab5a7..4f6674576e8ef 100644 --- a/Framework/Core/include/Framework/MessageContext.h +++ b/Framework/Core/include/Framework/MessageContext.h @@ -528,6 +528,7 @@ class MessageContext o2::header::DataHeader* findMessageHeader(const Output& spec); o2::header::Stack* findMessageHeaderStack(const Output& spec); int countDeviceOutputs(bool excludeDPLOrigin = false); + void fakeDispatch() { mDidDispatch = true; } o2::framework::DataProcessingHeader* findMessageDataProcessingHeader(const Output& spec); std::pair findMessageHeaders(const Output& spec);