AnatolyPopov commented on code in PR #16434:
URL: https://github.com/apache/iceberg/pull/16434#discussion_r3576827296


##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/Coordinator.java:
##########
@@ -150,22 +152,57 @@ protected boolean receive(Envelope envelope) {
   private void commit(boolean partialCommit) {
     try {
       doCommit(partialCommit);
+      if (!partialCommit) {
+        consecutiveCommitFailures = 0;
+      }
     } catch (RuntimeException e) {
       if (partialCommit) {
         LOG.warn(
             "Partial commit {} failed for task {}, will retry",
             commitState.currentCommitId(),
             taskId,
             e);
-      } else {
-        LOG.error("Commit {} failed for task {}", 
commitState.currentCommitId(), taskId, e);
+        return;
+      }
+
+      if (!isCommitFailedException(e)) {

Review Comment:
   I actually doubt that this method is necessary and the we need to check the 
cause of the exception caught here after re-checking the parallel Tasks path. 
The worker adds the original exception to the queue before its Future completes 
and waitFor only later adds the ExecutionException. throwOne therefore selects 
the original exception, and ExceptionUtil.castAndThrow rethrows a 
RuntimeException unchanged. A bare CommitFailedException reaches Coordinator 
with both single and multiple commit thread as far as I understand.
   
   And the test that covers this throws manually created exception that does 
not seem to be possible in production code.



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