Skip to content

Commit

Permalink
DPL: Check for EoS on all channels before invoking control->endOfStre…
Browse files Browse the repository at this point in the history
…am()
  • Loading branch information
davidrohr committed Oct 18, 2023
1 parent f33b30c commit dbb5102
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Framework/Core/src/ExternalFairMQDeviceProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

namespace o2::framework
{
// We do not allow to send EoS in online runs, until we receive (which is checked below) them upstream (to prevent premature shutdown of calibration)
static bool gAllowEoSdefault = !(DefaultsHelpers::deploymentMode() == DeploymentMode::OnlineDDS || DefaultsHelpers::deploymentMode() == DeploymentMode::OnlineECS);
static bool gAllowEoS = gAllowEoSdefault;

Expand Down Expand Up @@ -815,7 +816,16 @@ DataProcessorSpec specifyExternalFairMQDeviceProxy(char const* name,
// * If a connection sends two EoS.
// * If a connection sends an end of stream closes and another one opens.
// Finally, if we didn't receive an EoS this time, out counting of the connected peers is off, so the best thing we can do is delay the EoS reporting
bool everyEoS = shouldstop || (numberOfEoS[ci] >= eosPeersCount[ci] && nEos);
bool everyEoS = shouldstop;
if (!shouldstop && nEos) {
everyEoS = true;
for (unsigned int i = 0; i < numberOfEoS.size(); i++) {
if (numberOfEoS[i] < eosPeersCount[i]) {
everyEoS = false;
break;
}
}
}

if (everyEoS) {
LOG(info) << "Received " << numberOfEoS[ci] << " end-of-stream from " << eosPeersCount[ci] << " peers, forwarding end-of-stream (shouldstop " << (int)shouldstop << ", nEos " << nEos << ", newRun " << (int)newRun << ")";
Expand Down

0 comments on commit dbb5102

Please sign in to comment.