edoardocomar commented on code in PR #21740:
URL: https://github.com/apache/kafka/pull/21740#discussion_r2941154638


##########
core/src/main/scala/kafka/network/SocketServer.scala:
##########
@@ -1047,6 +1050,9 @@ private[kafka] class Processor(
         // note that even though we got an exception, we can assume that 
receive.source is valid.
         // Issues with constructing a valid receive object were handled earlier
         case e: Throwable =>
+          if (header == null || req == null || 
header.apiKey.requiresDelayedAllocation) {
+             receive.close() // return buffer to memory pool

Review Comment:
   I don't think it's needed really - also the memory pool will get the memory 
back not just when invoking NetworkReceive.close() but also bypassing that from 
Request.releaseBuffer().
   
   Possibly because of these multiple ways of releasing the memory that this 
leak could go unnnoticed for long. 



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