-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DPL: fix dropped obsolete messages with faster rates (#5462)
This should reduce the amount of messages being dropped if the rate becomes to high.
- Loading branch information
Showing
4 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright CERN and copyright holders of ALICE O2. This software is | ||
// distributed under the terms of the GNU General Public License v3 (GPL | ||
// Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// See http://alice-o2.web.cern.ch/license for full licensing information. | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
#include "Framework/ConfigParamSpec.h" | ||
#include "Framework/CompletionPolicyHelpers.h" | ||
#include "Framework/DeviceSpec.h" | ||
#include "Framework/RawDeviceService.h" | ||
#include "Framework/ControlService.h" | ||
#include <FairMQDevice.h> | ||
#include <InfoLogger/InfoLogger.hxx> | ||
|
||
#include <chrono> | ||
#include <thread> | ||
#include <vector> | ||
|
||
#include "Framework/runDataProcessing.h" | ||
using namespace o2::framework; | ||
|
||
// This is how you can define your processing in a declarative way | ||
WorkflowSpec defineDataProcessing(ConfigContext const& specs) | ||
{ | ||
return WorkflowSpec{ | ||
{"A", | ||
Inputs{}, | ||
{OutputSpec{{"a"}, "TST", "A"}}, | ||
AlgorithmSpec{adaptStateful([]() { return adaptStateless( | ||
[](DataAllocator& outputs, RawDeviceService& device, ControlService& control) { | ||
static int count = 0; | ||
auto& aData = outputs.make<int>(OutputRef{"a"}); | ||
LOG(info) << count; | ||
aData = count++; | ||
if (count > 3000) { | ||
control.endOfStream(); | ||
control.readyToQuit(QuitRequest::Me); | ||
} | ||
}); })}}, | ||
{"B", | ||
{InputSpec{"x", "TST", "A", Lifetime::Timeframe}}, | ||
{}, | ||
AlgorithmSpec{adaptStateful([]() { return adaptStateless( | ||
[](InputRecord& inputs, RawDeviceService& device, ControlService& control) { | ||
static int expected = 0; | ||
device.device()->WaitFor(std::chrono::milliseconds(3)); | ||
auto& count = inputs.get<int>("x"); | ||
if (expected != count) { | ||
LOGP(ERROR, "Missing message. Expected: {}, Found {}.", expected, count); | ||
control.readyToQuit(QuitRequest::All); | ||
} | ||
expected++; | ||
}); })}}}; | ||
} |