Chaffelson opened a new pull request, #10988:
URL: https://github.com/apache/nifi/pull/10988

   # Summary
   
   [NIFI-15690](https://issues.apache.org/jira/browse/NIFI-15690) Fixes a 
ByteBuf memory leak in `CacheRequestDecoder.readHeader()`.
   
   The `readHeader()` method calls `byteBuf.readBytes(HEADER_LENGTH)` which 
allocates a new `ByteBuf` containing the header bytes. This buffer is never 
assigned to a variable or released, causing a memory leak detected by Netty's 
`ResourceLeakDetector`:
   
   ```
   LEAK: ByteBuf.release() was not called before it's garbage-collected.
   ...
   at 
org.apache.nifi.distributed.cache.server.codec.CacheRequestDecoder.readHeader(CacheRequestDecoder.java:238)
   ```
   
   The header bytes are not used after reading — they are discarded without 
inspection. The fix replaces `readBytes()` with `skipBytes()` which advances 
the reader index without allocation.
   
   # Changes
   
   - `CacheRequestDecoder.readHeader()`: Changed 
`byteBuf.readBytes(HEADER_LENGTH)` to `byteBuf.skipBytes(HEADER_LENGTH)`
   
   # Testing
   
   Existing tests in `StandardMapCacheServerTest` exercise the header parsing 
code path and continue to pass.
   
   # Tracking
   
   - [NIFI-15690](https://issues.apache.org/jira/browse/NIFI-15690)


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