You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/10/11 08:25:16 UTC

[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3053: [Improve] close resources in finally block

CalvinKirs commented on code in PR #3053:
URL: https://github.com/apache/incubator-seatunnel/pull/3053#discussion_r991999499


##########
seatunnel-core/seatunnel-core-flink/src/main/java/org/apache/seatunnel/core/flink/command/FlinkApiTaskExecuteCommand.java:
##########
@@ -80,9 +80,10 @@ public void execute() throws CommandExecuteException {
                 FlinkEnvironment> execution = new ExecutionFactory<>(executionContext).createExecution()) {
             prepare(executionContext.getEnvironment(), sources, transforms, sinks);
             execution.start(sources, transforms, sinks);
-            close(sources, transforms, sinks);
         } catch (Exception e) {
             throw new CommandExecuteException("Execute Flink task error", e);
+        } finally {
+            close(sources, transforms, sinks);

Review Comment:
   It's a bit strange to add it here, and it won't close if an exception occurs above(`showAsciiLogo`)



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org