snehashisp commented on code in PR #12784:
URL: https://github.com/apache/kafka/pull/12784#discussion_r1006427140


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTask.java:
##########
@@ -280,15 +282,16 @@ private void commitTransaction() {
 
         // Commit the transaction
         // Blocks until all outstanding records have been sent and ack'd
-        try {
-            producer.commitTransaction();
-        } catch (Throwable t) {
-            log.error("{} Failed to commit producer transaction", 
ExactlyOnceWorkerSourceTask.this, t);
-            flushError.compareAndSet(null, t);
+        if (flushFuture != null) {

Review Comment:
   This might mean that we never end up doing a commit if there are no offsets 
to commit, for example if the connector never returns any offsets. There might 
still be SourceRecords to send. Not sure if any connector does this, but we 
should not ignore this edge case regardless. 
   
   Maybe we can simply check if flushError is set instead. The callback should 
be invoked and the error set immediately in case of a serialisation failure.  



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to