ruanwenjun commented on code in PR #17718:
URL: 
https://github.com/apache/dolphinscheduler/pull/17718#discussion_r2592057515


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsHook.java:
##########
@@ -141,10 +141,19 @@ public void stopReplicationTask() {
         if (replicationTaskArn == null) {
             return;
         }
-        StopReplicationTaskRequest request = new StopReplicationTaskRequest()
-                .withReplicationTaskArn(replicationTaskArn);
-        client.stopReplicationTask(request);
-        awaitReplicationTaskStatus(STATUS.STOPPED);
+        try {
+            StopReplicationTaskRequest request = new 
StopReplicationTaskRequest()
+                    .withReplicationTaskArn(replicationTaskArn);
+            client.stopReplicationTask(request);
+            awaitReplicationTaskStatus(STATUS.STOPPED);
+        } catch (Exception e) {
+            log.error("stopReplicationTask error: ", e);
+        } finally {
+            if (client != null) {
+                // shutdown client
+                client.shutdown();
+            }
+        }

Review Comment:
   We don't need to close resource when canceling, have you test this? Please 
at least test in real environment when submit a PR.



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