Skip to content

Commit

Permalink
[FLINK-21768][client]Optimize system.exit() logic of CliFrontend
Browse files Browse the repository at this point in the history
This closes apache#15185.
  • Loading branch information
zuston authored and tillrohrmann committed Mar 22, 2021
1 parent 37a8e3c commit f3155e6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1124,19 +1124,19 @@ public static void main(final String[] args) {
final List<CustomCommandLine> customCommandLines =
loadCustomCommandLines(configuration, configurationDirectory);

int retCode = 31;
try {
final CliFrontend cli = new CliFrontend(configuration, customCommandLines);

SecurityUtils.install(new SecurityConfiguration(cli.configuration));
int retCode =
SecurityUtils.getInstalledContext().runSecured(() -> cli.parseAndRun(args));
System.exit(retCode);
retCode = SecurityUtils.getInstalledContext().runSecured(() -> cli.parseAndRun(args));
} catch (Throwable t) {
final Throwable strippedThrowable =
ExceptionUtils.stripException(t, UndeclaredThrowableException.class);
LOG.error("Fatal error while running command line interface.", strippedThrowable);
strippedThrowable.printStackTrace();
System.exit(31);
} finally {
System.exit(retCode);
}
}

Expand Down

0 comments on commit f3155e6

Please sign in to comment.