dnadolny commented on code in PR #21065:
URL: https://github.com/apache/kafka/pull/21065#discussion_r2666491549
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -1031,12 +1031,30 @@ BuiltInPartitioner createBuiltInPartitioner(LogContext
logContext, String topic,
*/
public void deallocate(ProducerBatch batch) {
incomplete.remove(batch);
+ deallocateIfNecessary(batch);
+ }
+
+ private void deallocateIfNecessary(ProducerBatch batch) {
// Only deallocate the batch if it is not a split batch because split
batch are allocated outside the
// buffer pool.
- if (!batch.isSplitBatch())
+ if (!batch.isSplitBatch() && !batch.isBufferDeallocated() &&
batch.setBufferDeallocated(true))
Review Comment:
The condition is a bit simpler now, though it's also expanded with logging
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]