ezhou413 commented on code in PR #23483:
URL: https://github.com/apache/kafka/pull/23483#discussion_r4126703150


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ChunkedByteBufferOutputStream.java:
##########
@@ -237,15 +261,32 @@ private void releaseUnusedChunks() {
         if (currentChunk == null)  // already deallocated; nothing attached
             return;
         List<ByteBuffer> unused = chunks.subList(currentChunkIndex + 1, 
chunks.size());
-        if (pool != null) {
-            for (ByteBuffer chunk : unused)
+        for (ByteBuffer chunk : unused) {
+            boolean poolOwned = removeByIdentity(poolAllocatedChunks, chunk);
+            if (poolOwned && pool != null)

Review Comment:
   Not right now. But since this class is public it's possible if it's used 
elsewhere in the future



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

Reply via email to