ezhou413 commented on code in PR #23483:
URL: https://github.com/apache/kafka/pull/23483#discussion_r4319426660
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ChunkedRecordAccumulator.java:
##########
@@ -286,8 +279,13 @@ public RecordAppendResult append(String topic,
/**
* Mid-batch extension: the open batch can still take this record so grow
it in place. The
- * acquire is non-blocking and fails fast when the pool is exhausted,
closing
- * {@code batchToExtend} for appends so the record retries on the
new-batch path (blocks for memory)
+ * acquire ({@link BufferPool#tryAllocateChunks}) is non-blocking and
fails fast when the pool is
+ * exhausted, closing {@code batchToExtend} for appends so the record
retries on the new-batch path
+ * (blocks for memory).
+ * <p>
+ * {@code tryAllocateChunks} also refuses once the pool is closed. That is
handled the same way: when the
+ * retry then needs a new batch, its blocking acquire throws {@link
KafkaException} for the closed pool
Review Comment:
Fixed
--
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]