Skip to content

Commit 18a57ba

Browse files
ehellbarktf
authored andcommitted
DPL: add command line option to print error instead of warning when exit transition timer expires
1 parent 54f5e87 commit 18a57ba

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ void on_transition_requested_expired(uv_timer_t* handle)
139139
// Check if this is a source device
140140
O2_SIGNPOST_ID_FROM_POINTER(cid, device, handle);
141141
auto& spec = ref->get<DeviceSpec const>();
142-
if (hasOnlyGenerated(spec)) {
143-
O2_SIGNPOST_EVENT_EMIT_ERROR(calibration, cid, "callback", "DPL exit transition grace period for source expired. Exiting.");
142+
std::string messageOnExpire = hasOnlyGenerated(spec) ? "DPL exit transition grace period for source expired. Exiting." : fmt::format("DPL exit transition grace period for {} expired. Exiting.", state.allowedProcessing == DeviceState::CalibrationOnly ? "calibration" : "data & calibration").c_str();
143+
if (!ref->get<RawDeviceService>().device()->GetConfig()->GetValue<bool>("error-on-exit-transition-timeout")) {
144+
O2_SIGNPOST_EVENT_EMIT_WARN(calibration, cid, "callback", "%{public}s", messageOnExpire.c_str());
144145
} else {
145-
O2_SIGNPOST_EVENT_EMIT_ERROR(calibration, cid, "callback", "DPL exit transition grace period for %{public}s expired. Exiting.",
146-
state.allowedProcessing == DeviceState::CalibrationOnly ? "calibration" : "data & calibration");
146+
O2_SIGNPOST_EVENT_EMIT_ERROR(calibration, cid, "callback", "%{public}s", messageOnExpire.c_str());
147147
}
148148
state.transitionHandling = TransitionHandlingState::Expired;
149149
}

Framework/Core/src/DeviceSpecHelpers.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
15411541
realOdesc.add_options()("child-driver", bpo::value<std::string>());
15421542
realOdesc.add_options()("rate", bpo::value<std::string>());
15431543
realOdesc.add_options()("exit-transition-timeout", bpo::value<std::string>());
1544+
realOdesc.add_options()("error-on-exit-transition-timeout", bpo::value<bool>()->zero_tokens());
15441545
realOdesc.add_options()("data-processing-timeout", bpo::value<std::string>());
15451546
realOdesc.add_options()("expected-region-callbacks", bpo::value<std::string>());
15461547
realOdesc.add_options()("timeframes-rate-limit", bpo::value<std::string>());
@@ -1728,6 +1729,7 @@ boost::program_options::options_description DeviceSpecHelpers::getForwardedDevic
17281729
("control-port", bpo::value<std::string>(), "Utility port to be used by O2 Control") //
17291730
("rate", bpo::value<std::string>(), "rate for a data source device (Hz)") //
17301731
("exit-transition-timeout", bpo::value<std::string>(), "timeout before switching to READY state") //
1732+
("error-on-exit-transition-timeout", bpo::value<bool>()->zero_tokens(), "print error instead of warning when exit transition timer expires") //
17311733
("data-processing-timeout", bpo::value<std::string>(), "timeout after which only calibration can happen") //
17321734
("expected-region-callbacks", bpo::value<std::string>(), "region callbacks to expect before starting") //
17331735
("timeframes-rate-limit", bpo::value<std::string>()->default_value("0"), "how many timeframes can be in fly") //

Framework/Core/src/runDataProcessing.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ int doChild(int argc, char** argv, ServiceRegistry& serviceRegistry,
10521052
("signposts", bpo::value<std::string>()->default_value(defaultSignposts ? defaultSignposts : ""), "comma separated list of signposts to enable") //
10531053
("expected-region-callbacks", bpo::value<std::string>()->default_value("0"), "how many region callbacks we are expecting") //
10541054
("exit-transition-timeout", bpo::value<std::string>()->default_value(defaultExitTransitionTimeout), "how many second to wait before switching from RUN to READY") //
1055+
("error-on-exit-transition-timeout", bpo::value<bool>()->zero_tokens()->default_value(false), "print error instead of warning when exit transition timer expires") //
10551056
("data-processing-timeout", bpo::value<std::string>()->default_value(defaultDataProcessingTimeout), "how many second to wait before stopping data processing and allowing data calibration") //
10561057
("timeframes-rate-limit", bpo::value<std::string>()->default_value("0"), "how many timeframe can be in fly at the same moment (0 disables)") //
10571058
("configuration,cfg", bpo::value<std::string>()->default_value("command-line"), "configuration backend") //

0 commit comments

Comments
 (0)