Hisoka-X commented on code in PR #3946:
URL:
https://github.com/apache/incubator-seatunnel/pull/3946#discussion_r1071771488
##########
seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java:
##########
@@ -112,14 +116,24 @@ public void execute() throws CommandExecuteException {
startTime = LocalDateTime.now();
// create job proxy
ClientJobProxy clientJobProxy = jobExecutionEnv.execute();
+ // register cancelJob hook
+ if (clientCommandArgs.isCloseJob()) {
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+ try {
+ shutdownHook(clientJobProxy);
+ } catch (Exception e) {
+ throw new
SeaTunnelEngineException(String.format("Cancel job exception and error is %s",
ExceptionUtils.getMessage(e)));
Review Comment:
need add log.error in here. Throw exception useless.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]