ezhou413 commented on code in PR #23483:
URL: https://github.com/apache/kafka/pull/23483#discussion_r4603120536
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ChunkedByteBufferOutputStream.java:
##########
@@ -144,6 +174,40 @@ private void ensureNotDeallocated() {
throw new IllegalStateException("operation not allowed after the
stream has been deallocated");
}
+ /**
+ * Makes sure the attached chunks have room for a write of {@code len}
bytes before any of it is written.
+ * A growable stream that is short attaches all the chunks the write still
needs in one step: as many as
+ * the pool can hand out without blocking, the rest from the heap (counted
in {@link #fallbackAllocations()}).
Review Comment:
I added an extra condition so that what you described in this batch of
comments doesn't happen, lmk if it looks good
--
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]