ijuma commented on a change in pull request #11722: URL: https://github.com/apache/kafka/pull/11722#discussion_r799828526
########## File path: clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java ########## @@ -448,40 +448,48 @@ public ReadyCheckResult ready(Cluster cluster, long nowMs) { boolean exhausted = this.free.queued() > 0; for (Map.Entry<TopicPartition, Deque<ProducerBatch>> entry : this.batches.entrySet()) { Deque<ProducerBatch> deque = entry.getValue(); + + final ProducerBatch batch; + final long waitedTimeMs; + final boolean backingOff; + final boolean full; + + // Collect as little as possible inside critical region, determine outcome after release synchronized (deque) { - // When producing to a large number of partitions, this path is hot and deques are often empty. - // We check whether a batch exists first to avoid the more expensive checks whenever possible. Review comment: I think the useful context that was removed is: > When producing to a large number of partitions, this path is hot and deques are often empty. -- 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