@@ -185,11 +185,17 @@ o2::framework::ServiceSpec CommonServices::streamContextSpec()
185185 auto & routes = processingContext.services ().get <DeviceSpec const >().outputs ;
186186 auto & timeslice = processingContext.services ().get <TimingInfo>().timeslice ;
187187 auto & messageContext = processingContext.services ().get <MessageContext>();
188+ auto dispatchState = messageContext.dispatchState ();
189+ O2_SIGNPOST_ID_FROM_POINTER (cid, stream_context, service);
190+ // Do not report discarded messages as missing outputs.
191+ if (dispatchState == MessageContext::DispatchState::Discarded) {
192+ O2_SIGNPOST_EVENT_EMIT_ERROR (stream_context, cid, " postProcessingCallbacks" , " Output messages discarded." );
193+ return ;
194+ }
188195 // Check if we never created any data for this timeslice
189- // if we did not, but we still have didDispatched set to true
196+ // if we did not, but messages were dispatched,
190197 // it means it was created out of band.
191198 bool userDidCreate = false ;
192- O2_SIGNPOST_ID_FROM_POINTER (cid, stream_context, service);
193199 for (size_t ri = 0 ; ri < routes.size (); ++ri) {
194200 if (stream->routeCreated [ri] == true && stream->routeDPLCreated [ri] == false ) {
195201 userDidCreate = true ;
@@ -198,14 +204,14 @@ o2::framework::ServiceSpec CommonServices::streamContextSpec()
198204 }
199205 O2_SIGNPOST_EVENT_EMIT (stream_context, cid, " postProcessingCallbacks" , " userDidCreate == %d && didDispatch == %d" ,
200206 userDidCreate,
201- messageContext. didDispatch () );
202- if (userDidCreate == false && messageContext. didDispatch () == true ) {
207+ dispatchState == MessageContext::DispatchState::Dispatched );
208+ if (userDidCreate == false && dispatchState == MessageContext::DispatchState::Dispatched ) {
203209 O2_SIGNPOST_EVENT_EMIT (stream_context, cid, " postProcessingCallbacks" , " Data created out of band userDidCreate == %d && messageContext.didDispatch == %d" ,
204210 userDidCreate,
205- messageContext. didDispatch () );
211+ dispatchState == MessageContext::DispatchState::Dispatched );
206212 return ;
207213 }
208- if (userDidCreate == false && messageContext. didDispatch () == false ) {
214+ if (userDidCreate == false && dispatchState == MessageContext::DispatchState::NotDispatched ) {
209215 O2_SIGNPOST_ID_FROM_POINTER (cid, stream_context, service);
210216 O2_SIGNPOST_EVENT_EMIT (stream_context, cid, " postProcessingCallbacks" , " No data created." );
211217 return ;
0 commit comments