Skip to content

Commit 815676e

Browse files
committed
DPL: do not add summary outputs more than once
This seem to be the cause for the spurious circular dependency for the internal-dpl-injected-dummy-sink.
1 parent 8391e4d commit 815676e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Framework/Core/src/WorkflowHelpers.cxx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,22 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext
368368
bool timeframeSink = hasTimeframeInputs && !hasTimeframeOutputs;
369369
if (std::stoi(ctx.options().get<std::string>("timeframes-rate-limit-ipcid")) != -1) {
370370
if (timeframeSink && processor.name.find("internal-dpl-injected-dummy-sink") == std::string::npos) {
371-
processor.outputs.push_back(OutputSpec{{"dpl-summary"}, ConcreteDataMatcher{"DPL", "SUMMARY", static_cast<DataAllocator::SubSpecificationType>(runtime_hash(processor.name.c_str()))}});
371+
O2_SIGNPOST_ID_GENERATE(sid, workflow_helpers);
372+
uint32_t hash = runtime_hash(processor.name.c_str());
373+
bool hasMatch = false;
374+
ConcreteDataMatcher summaryMatcher = ConcreteDataMatcher{"DPL", "SUMMARY", static_cast<DataAllocator::SubSpecificationType>(hash)};
375+
for (auto& output : processor.outputs) {
376+
if (DataSpecUtils::match(output, summaryMatcher)) {
377+
O2_SIGNPOST_EVENT_EMIT(workflow_helpers, sid, "output enumeration", "%{public}s already there in %{public}s",
378+
DataSpecUtils::describe(output).c_str(), processor.name.c_str());
379+
hasMatch = true;
380+
break;
381+
}
382+
}
383+
if (!hasMatch) {
384+
O2_SIGNPOST_EVENT_EMIT(workflow_helpers, sid, "output enumeration", "Adding DPL/SUMMARY/%d to %{public}s", hash, processor.name.c_str());
385+
processor.outputs.push_back(OutputSpec{{"dpl-summary"}, ConcreteDataMatcher{"DPL", "SUMMARY", static_cast<DataAllocator::SubSpecificationType>(hash)}});
386+
}
372387
}
373388
}
374389
bool hasConditionOption = false;

0 commit comments

Comments
 (0)