tillrohrmann commented on a change in pull request #14906:
URL: https://github.com/apache/flink/pull/14906#discussion_r572908392
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
##########
@@ -573,25 +573,22 @@ public static void runClusterEntrypoint(ClusterEntrypoint
clusterEntrypoint) {
System.exit(STARTUP_FAILURE_RETURN_CODE);
}
- clusterEntrypoint
- .getTerminationFuture()
- .whenComplete(
- (applicationStatus, throwable) -> {
- final int returnCode;
-
- if (throwable != null) {
- returnCode = RUNTIME_FAILURE_RETURN_CODE;
- } else {
- returnCode =
applicationStatus.processExitCode();
- }
-
- LOG.info(
- "Terminating cluster entrypoint process {}
with exit code {}.",
- clusterEntrypointName,
- returnCode,
- throwable);
- System.exit(returnCode);
- });
+ int returnCode;
+ Throwable throwable = null;
+
+ try {
+ returnCode =
clusterEntrypoint.getTerminationFuture().get().processExitCode();
+ } catch (Throwable e) {
+ throwable = e;
Review comment:
I think we can strip potential `ExecutionExceptions` via
`ExceptionUtils.stripExecutionException`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]