Skip to content

Commit 24c97f2

Browse files
authored
DPL: fix setting of run number (#14152)
This is actually a workaround. The real issue is that timer at the moment are completely outside of the data streaming and therefore do not have access to the DataTakingService, where the proper calculation for the run number happens and it's cached. OK for now. In the future we should make sure that the LifetimeHelpers::enumerate gets a "Streaming" context, not the global one.
1 parent 793542f commit 24c97f2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Framework/Core/src/LifetimeHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ ExpirationHandler::Handler LifetimeHelpers::enumerate(ConcreteDataMatcher const&
423423
dh.payloadSerializationMethod = gSerializationMethodNone;
424424
dh.tfCounter = timestamp;
425425
try {
426-
dh.runNumber = atoi(services.get<DataTakingContext>().runNumber.c_str());
426+
dh.runNumber = strtoull(services.get<RawDeviceService>().device()->fConfig->GetProperty<std::string>("runNumber", "0").c_str(), nullptr, 10);
427427
} catch (...) {
428428
dh.runNumber = 0;
429429
}

Framework/Core/test/test_SimpleTimer.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ std::vector<DataProcessorSpec> defineDataProcessing(ConfigContext const&)
3838
InputSpec{"atimer", "TST", "TIMER", 0, Lifetime::Timer}},
3939
{},
4040
AlgorithmSpec{
41-
adaptStateless([](ControlService& control) {
41+
adaptStateless([](ControlService& control, InputRecord& inputs) {
42+
DataRef ref = inputs.get("atimer");
43+
auto* header = o2::header::get<o2::header::DataHeader*>(ref.header);
44+
LOG(info) << "Run number: " << header->runNumber;
4245
// This is invoked autonomously by the timer.
4346
control.readyToQuit(QuitRequest::Me);
4447
})}},

0 commit comments

Comments
 (0)