slfan1989 opened a new pull request, #1355: URL: https://github.com/apache/ratis/pull/1355
### What changes were proposed in this pull request? This PR adds leak detection and cleanup mechanisms to `ZeroCopyMessageMarshaller` to prevent resource leaks in tests and provide safety guardrails for potential future production use: **ZeroCopyMessageMarshaller:** - Add `getUnclosedCount():` Returns the number of unclosed streams for monitoring - Add `checkLeaks(String context):` Asserts no unclosed streams exist, throws IllegalStateException if leaks are detected - Add `close():` Cleanup method that closes all unclosed streams with logging as a last-resort fallback ### What is the link to the Apache JIRA RATIS-2414. Add leak detection for ZeroCopyMessageMarshaller. Please replace this section with the link to the Apache JIRA) ### How was this patch tested? Add Junit Test. -- 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]
