ijuma commented on a change in pull request #10620:
URL: https://github.com/apache/kafka/pull/10620#discussion_r624518310



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
##########
@@ -710,8 +710,11 @@ private boolean appendsInProgress() {
      */
     public void awaitFlushCompletion() throws InterruptedException {
         try {
-            for (ProducerBatch batch : this.incomplete.copyAll())
-                batch.produceFuture.await();
+            // Make a copy of of the request results at the time the flush is 
called.
+            // We avoid making a copy of the full incomplete batch collections 
to allow
+            // garbage collection.

Review comment:
       Hmm, we still have a reference to `incomplete` in the class, right? Are 
we expecting the GC to free that while blocked in this method?

##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
##########
@@ -710,8 +710,11 @@ private boolean appendsInProgress() {
      */
     public void awaitFlushCompletion() throws InterruptedException {
         try {
-            for (ProducerBatch batch : this.incomplete.copyAll())
-                batch.produceFuture.await();
+            // Make a copy of of the request results at the time the flush is 
called.
+            // We avoid making a copy of the full incomplete batch collections 
to allow
+            // garbage collection.

Review comment:
       Hmm, we still have a reference to `incomplete` in this instance, right? 
Are we expecting the GC to free that while blocked in this method?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to