divijvaidya commented on code in PR #12228:
URL: https://github.com/apache/kafka/pull/12228#discussion_r903557818


##########
clients/src/main/java/org/apache/kafka/common/network/Selector.java:
##########
@@ -809,6 +810,13 @@ private void maybeCloseOldestConnection(long 
currentTimeNanos) {
      * poll().
      */
     public void clearCompletedReceives() {
+        this.completedReceives.values().forEach(networkReceive -> {
+            try {
+                networkReceive.close();

Review Comment:
   Thanks. I added the following comment to the `Selector.completedReceives()` 
in the latest commit.
   ```
   Note that the caller of this method assumes responsibility to close the 
NetworkReceive resources which may be
   backed by a {@link MemoryPool}. In such scenarios (when NetworkReceive uses 
a {@link MemoryPool}, it is necessary
   to close the {@link NetworkReceive} to prevent any memory leaks.
   ```
   
   The new revision is ready for your review.



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