ruanwenjun commented on a change in pull request #1530:
URL: 
https://github.com/apache/incubator-seatunnel/pull/1530#discussion_r831800695



##########
File path: 
seatunnel-core/seatunnel-core-base/src/main/java/org/apache/seatunnel/command/BaseTaskExecuteCommand.java
##########
@@ -73,6 +73,24 @@ protected final void prepare(E env, List<? extends 
Plugin<E>>... plugins) {
         }
     }
 
+    /**
+     * Execute close method defined in {@link 
org.apache.seatunnel.plugin.Plugin}
+     *
+     * @param plugins plugin list
+     */
+    @SafeVarargs
+    protected final void close(List<? extends Plugin<E>>... plugins) {
+        for (List<? extends Plugin<E>> pluginList : plugins) {
+            pluginList.forEach(plugin -> {
+                try {
+                    plugin.close();

Review comment:
       @yx91490 Yes, close is mainly used to do resource clean, this is a good 
catch, I have added some comment in `close` method.
   We have another choose to catch the exception and make it safe to close for 
each plugin, but I think throw it directly is OK.




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