LiJie20190102 commented on code in PR #10292:
URL: https://github.com/apache/seatunnel/pull/10292#discussion_r2670528843


##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java:
##########
@@ -186,13 +186,30 @@ public SeaTunnelRow getNext() {
 
     public void close() {
         log.info("Close reader for {}:{} with context id {}", ip, port, 
contextId);
+        if (contextId == null) {
+            // not opened yet
+            return;
+        }
         TScanCloseParams tScanCloseParams = new TScanCloseParams();
         tScanCloseParams.setContext_id(this.contextId);
-        try {
-            this.client.close_scanner(tScanCloseParams);
-        } catch (TException e) {
-            log.error("Failed to close reader {}:{} with context id {}", ip, 
port, contextId, e);
-            throw new StarRocksConnectorException(CLOSE_BE_READER_FAILED, e);
+        for (int i = 0; i < 3; i++) {
+            try {
+                this.client.close_scanner(tScanCloseParams);
+                break;
+            } catch (Exception e) {
+                log.error(
+                        "Failed to close reader {}:{} with context id {}", ip, 
port, contextId, e);

Review Comment:
   If an exception is thrown here, then this retry is 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]

Reply via email to