Copilot commented on code in PR #694:
URL: 
https://github.com/apache/doris-flink-connector/pull/694#discussion_r3932693081


##########
flink-doris-connector/flink-doris-connector-base/src/main/java/org/apache/doris/flink/sink/writer/tvf/S3TvfCommitter.java:
##########
@@ -88,16 +89,25 @@ public void 
commit(Collection<CommitRequest<S3TvfCommittable>> requests)
     private boolean commitOne(S3TvfCommittable committable) throws 
IOException, SQLException {
         String insertSql = sqlBuilder.buildInsertSql(committable);
         for (int attempt = 0; attempt <= maxRetries; attempt++) {
+            long insertStartedAtNanos = System.nanoTime();
             try {
                 loadClient.executeInsert(insertSql, sessionVariables);
-                LOG.info("TVF load committed with label {}.", 
committable.getLabel());
+                LOG.info(
+                        "TVF insert completed, label={}, objectCount={}, 
attempt={}, "
+                                + "insertTimeMs={}.",
+                        committable.getLabel(),
+                        committable.getObjectKeys().size(),
+                        attempt + 1,
+                        TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - 
insertStartedAtNanos));
                 return false;
             } catch (SQLException e) {
                 LOG.warn(
-                        "TVF insert failed for label {} on attempt {} "
-                                + "(SQLState={}, errorCode={}).",
+                        "TVF insert failed, label={}, objectCount={}, 
attempt={}, "
+                                + "insertTimeMs={}, SQLState={}, 
errorCode={}.",
                         committable.getLabel(),
+                        committable.getObjectKeys().size(),
                         attempt + 1,
+                        TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - 
insertStartedAtNanos),
                         e.getSQLState(),
                         e.getErrorCode());

Review Comment:
   The `SQLException` caught during TVF insert retries is not passed to the 
logger, so the warning logs lose the stack trace and any chained causes. 
Including the exception object makes failures diagnosable without changing 
control flow.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to