ijuma commented on code in PR #12752:
URL: https://github.com/apache/kafka/pull/12752#discussion_r996499836


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -127,7 +127,9 @@ public RecordAccumulator(LogContext logContext,
         this.closed = false;
         this.flushesInProgress = new AtomicInteger(0);
         this.appendsInProgress = new AtomicInteger(0);
-        this.batchSize = batchSize;
+        // As per Kafka producer configuration documentation batch.size may be 
set to 0 to explicitly disable
+        // batching which in practice actually means using a batch size of 1.
+        this.batchSize = Math.max(1, batchSize);

Review Comment:
   Whether code changed or not is not the defining point on how to design 
things. The comment you added to the code seems generally applicable and not 
specific to `RecordAccumulator`. If batch size of 0 really means batch size of 
1, we should do that consistently across the components. Or else we may have 
regressions in other components the same way we had one here.



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