You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/10/27 05:50:41 UTC
[GitHub] [kafka] snehashisp commented on a diff in pull request #12784: MINOR: Do not perform prodcuerCommit on serializationError when trying offsetWriter flush
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org