Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always surface normalization failure reason #20025

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,25 @@ public NormalizationSummary run(final NormalizationInput input, final Path jobRo
}
} catch (final Exception e) {
ApmTraceUtils.addExceptionToTrace(e);
LOGGER.error("Normalization failed for job {}.", jobId, e);
buildFailureReasonsAndSetFailure();
}

if (cancelled.get()) {
LOGGER.info("Normalization was cancelled.");
LOGGER.info("Normalization was cancelled for job {}.", jobId);
}

final long endTime = System.currentTimeMillis();
final Duration duration = Duration.ofMillis(endTime - startTime);
final String durationDescription = DurationFormatUtils.formatDurationWords(duration.toMillis(), true, true);
LOGGER.info("Normalization executed in {}.", durationDescription);
LOGGER.info("Normalization executed in {} for job {}.", durationDescription, jobId);

final NormalizationSummary summary = new NormalizationSummary()
.withStartTime(startTime)
.withEndTime(endTime);

if (!traceFailureReasons.isEmpty()) {
summary.setFailures(traceFailureReasons);
LOGGER.error("Normalization Failed.");
} else if (failed) {
throw new WorkerException("Normalization Failed.");
}
Expand Down