corgy-w commented on code in PR #10400:
URL: https://github.com/apache/seatunnel/pull/10400#discussion_r2732475046
##########
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:
The following is a dubug log
--
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]