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


##########
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:
   > I mean the above lines of code, but anyway, it's a bit strange to put here
   
   but `close` in try block, it won't close resources if an exception occurs 
`execution.start`, so i move it to finally.



-- 
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]

Reply via email to