Skip to content

Commit 0e958ca

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 9bbf6ec commit 0e958ca

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
@@ -240,7 +240,6 @@ auto DataProcessingHelpers::routeForwardedMessages(FairMQDeviceProxy& proxy,
240240

241241
for (size_t ii = 0, ie = currentSetOfInputs.size(); ii < ie; ++ii) {
242242
auto& messageSet = currentSetOfInputs[ii];
243-
forwardingChoices.clear();
244243

245244
for (size_t pi = 0; pi < messageSet.size(); ++pi) {
246245
auto& header = messageSet.header(pi);
@@ -291,6 +290,7 @@ auto DataProcessingHelpers::routeForwardedMessages(FairMQDeviceProxy& proxy,
291290
// - If it's a message of the kind [header0][payload1][payload2][payload3]... and therefore
292291
// we will already use the same choice in the for loop below.
293292
if (dh->splitPayloadIndex == 0 || dh->splitPayloadParts <= 1 || messageSet.getNumberOfPayloads(pi) > 0) {
293+
forwardingChoices.clear();
294294
proxy.getMatchingForwardChannelIndexes(forwardingChoices, *dh, dph->startTime);
295295
}
296296

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)