Skip to content

Commit aa1ca7a

Browse files
authored
DPL: improve logs for new calibration scheme (#14030)
- Report correct timeout for readers. - Improve message when dropping data which is not going to be processed by the CalibrationOnly mode.
1 parent 38acc6f commit aa1ca7a

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,10 +1400,15 @@ void DataProcessingDevice::Run()
14001400
O2_SIGNPOST_EVENT_EMIT(calibration, lid, "timer_setup", "Starting %d s timer for exitTransitionTimeout.",
14011401
deviceContext.exitTransitionTimeout);
14021402
uv_timer_start(deviceContext.gracePeriodTimer, on_transition_requested_expired, deviceContext.exitTransitionTimeout * 1000, 0);
1403-
if (mProcessingPolicies.termination == TerminationPolicy::QUIT) {
1404-
O2_SIGNPOST_EVENT_EMIT_INFO(device, lid, "run_loop", "New state requested. Waiting for %d seconds before quitting.", (int)deviceContext.exitTransitionTimeout);
1403+
bool onlyGenerated = hasOnlyGenerated(spec);
1404+
int timeout = onlyGenerated ? deviceContext.dataProcessingTimeout : deviceContext.exitTransitionTimeout;
1405+
if (mProcessingPolicies.termination == TerminationPolicy::QUIT && DefaultsHelpers::onlineDeploymentMode() == false) {
1406+
O2_SIGNPOST_EVENT_EMIT_INFO(device, lid, "run_loop", "New state requested. Waiting for %d seconds before quitting.", timeout);
14051407
} else {
1406-
O2_SIGNPOST_EVENT_EMIT_INFO(device, lid, "run_loop", "New state requested. Waiting for %d seconds before switching to READY state.", (int)deviceContext.exitTransitionTimeout);
1408+
O2_SIGNPOST_EVENT_EMIT_INFO(device, lid, "run_loop",
1409+
"New state requested. Waiting for %d seconds before %{public}s",
1410+
timeout,
1411+
onlyGenerated ? "dropping remaining input and switching to READY state." : "switching to READY state.");
14071412
}
14081413
} else {
14091414
state.transitionHandling = TransitionHandlingState::Expired;

Framework/Core/src/DataRelayer.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
#include "Framework/DeviceState.h"
1112
#include "Framework/RootSerializationSupport.h"
1213
#include "Framework/DataRelayer.h"
1314
#include "Framework/DataProcessingStats.h"
@@ -43,6 +44,7 @@
4344
#include <Monitoring/Metric.h>
4445
#include <Monitoring/Monitoring.h>
4546

47+
#include <fairlogger/Logger.h>
4648
#include <fairmq/Channel.h>
4749
#include <functional>
4850
#if __has_include(<fairmq/shmem/Message.h>)
@@ -347,9 +349,21 @@ void DataRelayer::setOldestPossibleInput(TimesliceId proposed, ChannelIndex chan
347349
if (element.size() == 0) {
348350
auto& state = mContext.get<DeviceState>();
349351
if (state.transitionHandling != TransitionHandlingState::NoTransition && DefaultsHelpers::onlineDeploymentMode()) {
350-
LOGP(warning, "Missing {} (lifetime:{}) while dropping incomplete data in slot {} with timestamp {} < {}.", DataSpecUtils::describe(input), input.lifetime, si, timestamp.value, newOldest.timeslice.value);
352+
if (state.allowedProcessing == DeviceState::CalibrationOnly) {
353+
O2_SIGNPOST_ID_GENERATE(cid, calibration);
354+
O2_SIGNPOST_EVENT_EMIT(calibration, cid, "expected_missing_data", "Expected missing %{public}s (lifetime:%d) while dropping non-calibration data in slot %zu with timestamp %zu < %zu.",
355+
DataSpecUtils::describe(input).c_str(), (int)input.lifetime, si, timestamp.value, newOldest.timeslice.value);
356+
} else {
357+
LOGP(info, "Missing {} (lifetime:{}) while dropping incomplete data in slot {} with timestamp {} < {}.", DataSpecUtils::describe(input), input.lifetime, si, timestamp.value, newOldest.timeslice.value);
358+
}
351359
} else {
352-
LOGP(error, "Missing {} (lifetime:{}) while dropping incomplete data in slot {} with timestamp {} < {}.", DataSpecUtils::describe(input), input.lifetime, si, timestamp.value, newOldest.timeslice.value);
360+
if (state.allowedProcessing == DeviceState::CalibrationOnly) {
361+
O2_SIGNPOST_ID_GENERATE(cid, calibration);
362+
O2_SIGNPOST_EVENT_EMIT_INFO(calibration, cid, "expected_missing_data", "Not processing in calibration mode: missing %s (lifetime:%d) while dropping incomplete data in slot %zu with timestamp %zu < %zu.",
363+
DataSpecUtils::describe(input).c_str(), (int)input.lifetime, si, timestamp.value, newOldest.timeslice.value);
364+
} else {
365+
LOGP(error, "Missing {} (lifetime:{}) while dropping incomplete data in slot {} with timestamp {} < {}.", DataSpecUtils::describe(input), input.lifetime, si, timestamp.value, newOldest.timeslice.value);
366+
}
353367
}
354368
}
355369
}

0 commit comments

Comments
 (0)