Skip to content

Commit

Permalink
Add StartUpTask timeout errors to pipeline logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dj-smart committed Aug 9, 2023
1 parent 3a07df7 commit a274712
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public final RuntimeInfo run(ProgramDescriptor programDescriptor, ProgramOptions
} catch (Exception e) {
controller.failed(e);
programStateWriter.error(programRunId, e);
LOG.error("Exception while trying to run program run {}", programRunId, e);
LOG.error("Exception while trying to run program with runID {}", programRunId, e);
}
});
return runtimeInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ public TwillController create(@Nullable Callable<Void> startupTask, long timeout

// If the startup task failed, publish failure state and delete the program running state
startupTaskCompletion.whenComplete((res, throwable) -> {
Map<String, String> systemArgs = programOpts.getArguments().asMap();
LoggingContext loggingContext = LoggingContextHelper.getLoggingContextWithRunId(
programRunId, systemArgs);
Cancellable restoreContext = LoggingContextAccessor.setLoggingContext(loggingContext);
if (throwable == null) {
LOG.debug("Startup task completed for program run {}", programRunId);
} else {
Expand All @@ -649,6 +653,7 @@ public TwillController create(@Nullable Callable<Void> startupTask, long timeout
}
programStateWriter.error(programRunId, throwable);
}
restoreContext.cancel();
});
} else {
// Otherwise, complete the startup task immediately
Expand Down

0 comments on commit a274712

Please sign in to comment.