slfan1989 opened a new pull request, #1358:
URL: https://github.com/apache/ratis/pull/1358

   ## What changes were proposed in this pull request?
   
   Fixed a memory leak in `DataStreamManagement` where `ChannelMap` entries 
were not properly cleaned up when `read()` fails early (e.g., protocol parsing 
errors before `readImpl()` completes).
   
   #### Changes:
   
   - Extracted `ClientInvocationId` and `ChannelId` calculation before calling 
`readImpl()` to ensure they are available in the exception handler
   - Added `channels.remove(channelId, key)` in the `read()` exception handler 
to properly clean up `ChannelMap` entries
   
   ## What is the link to the Apache JIRA
   
   JIRA: RATIS-2417. Fix ChannelMap memory leak in DataStreamManagement when 
read() fails early.
   
   ## How was this patch tested?
   
   Added `TestDataStreamManagement` unit test in ratis-test module.


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