Skip to content

Commit 135238e

Browse files
committed
DPL: fix routing issues in forwarding
If one (header, payload, ...) tuple in a MessageSet was to be copied, all the subsequent ones would have been copied. If one (header, payload, ...) tuple got redirected to more than one destination, all the subsequent ones would have been redirected there.
1 parent d54ec0d commit 135238e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Framework/Core/src/DataProcessingHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ auto DataProcessingHelpers::routeForwardedMessages(FairMQDeviceProxy& proxy,
233233

234234
for (size_t ii = 0, ie = currentSetOfInputs.size(); ii < ie; ++ii) {
235235
auto& messageSet = currentSetOfInputs[ii];
236-
forwardingChoices.clear();
237236

238237
for (size_t pi = 0; pi < messageSet.size(); ++pi) {
239238
auto& header = messageSet.header(pi);
@@ -284,6 +283,7 @@ auto DataProcessingHelpers::routeForwardedMessages(FairMQDeviceProxy& proxy,
284283
// - If it's a message of the kind [header0][payload1][payload2][payload3]... and therefore
285284
// we will already use the same choice in the for loop below.
286285
if (dh->splitPayloadIndex == 0 || dh->splitPayloadParts <= 1 || messageSet.getNumberOfPayloads(pi) > 0) {
286+
forwardingChoices.clear();
287287
proxy.getMatchingForwardChannelIndexes(forwardingChoices, *dh, dph->startTime);
288288
}
289289

Framework/Core/test/test_ForwardInputs.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,7 @@ TEST_CASE("ForwardInputsSplitPayload")
614614
auto result = o2::framework::DataProcessingHelpers::routeForwardedMessages(proxy, currentSetOfInputs, copyByDefault, consume);
615615
REQUIRE(result.size() == 2); // Two routes
616616
CHECK(result[0].Size() == 2); // No messages on this route
617-
CHECK(result[1].Size() == 5); // FIXME: Multipart matching has side effects also for the elements
618-
// CHECK(result[1].Size() == 3); // FIXME: the correct forwarding is that only the multipart goes to the same route
617+
CHECK(result[1].Size() == 3);
619618
}
620619

621620
TEST_CASE("ForwardInputEOSSingleRoute")

0 commit comments

Comments
 (0)