squah-confluent commented on code in PR #20847:
URL: https://github.com/apache/kafka/pull/20847#discussion_r2570796296
##########
clients/src/main/java/org/apache/kafka/common/utils/BufferSupplier.java:
##########
@@ -82,11 +90,13 @@ public void release(ByteBuffer buffer) {
// We currently keep a single buffer in flight, so optimise for
that case
Deque<ByteBuffer> bufferQueue =
bufferMap.computeIfAbsent(buffer.capacity(), k -> new ArrayDeque<>(1));
bufferQueue.addLast(buffer);
+ cachedSize += buffer.capacity();
}
Review Comment:
Can we have some tests for the `BufferSupplier` size implementations? This
one doesn't look correct. If we get and release the same buffer multiple times,
`cachedSize` will keep going up.
--
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]