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


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcOutputFormat.java:
##########
@@ -126,43 +128,112 @@ public synchronized void flush() throws IOException {
             return;
         }
         if (batchCount == 0) {
-            LOG.debug("No data to flush.");
+            LOG.debug("Skip flush: no buffered records.");
             return;
         }
-
-        final int sleepMs = 1000;
-        for (int i = 0; i <= jdbcConnectionConfig.getMaxRetries(); i++) {
+        final int maxRetries = jdbcConnectionConfig.getMaxRetries();
+        final long baseBackoffMs = 1000L;
+        final long maxBackoffMs = 10_000L;
+        for (int attempt = 0; attempt <= maxRetries; attempt++) {
             try {
+                LOG.debug(
+                        "Start flush. batchCount={}, attempt={}/{}",
+                        batchCount,
+                        attempt,
+                        maxRetries);
                 attemptFlush();
                 batchCount = 0;
-                break;
-            } catch (SQLException e) {
-                LOG.error("JDBC executeBatch error, retry times = {}", i, e);
-                if (i >= jdbcConnectionConfig.getMaxRetries()) {
+                LOG.debug("Flush success. attempt={}/{}", attempt, maxRetries);

Review Comment:
   I don't think it's necessary to print out this log. What do you think



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcOutputFormat.java:
##########


Review Comment:
   This method body is too long. Could you extract it appropriately



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