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 2021/09/28 17:36:00 UTC

[GitHub] [kafka] hachikuji commented on a change in pull request #11362: KAFKA-13319: Do not commit empty offsets on producer

hachikuji commented on a change in pull request #11362:
URL: https://github.com/apache/kafka/pull/11362#discussion_r717817262



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
##########
@@ -704,11 +704,14 @@ public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offs
         throwIfInvalidGroupMetadata(groupMetadata);
         throwIfNoTransactionManager();
         throwIfProducerClosed();
-        long start = time.nanoseconds();
-        TransactionalRequestResult result = transactionManager.sendOffsetsToTransaction(offsets, groupMetadata);
-        sender.wakeup();
-        result.await(maxBlockTimeMs, TimeUnit.MILLISECONDS);
-        producerMetrics.recordSendOffsets(time.nanoseconds() - start);
+
+        if (offsets.isEmpty()) {

Review comment:
       This check should be inverted.




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