lhotari opened a new pull request, #24272: URL: https://github.com/apache/pulsar/pull/24272
### Motivation Memory leaks in Netty buffers can lead to performance degradation, resource exhaustion, and unpredictable failures in production. A key challenge we face is that these leaks often go undetected until they cause issues in production environments. Currently, our CI pipeline lacks the capability to systematically detect and prevent Netty buffer leaks before they reach production code. This creates a significant blind spot that allows buffer leak regressions to slip through our quality gates. This PR addresses this gap by implementing advanced Netty leak detection capabilities within the Pulsar CI pipeline. The implementation follows a staged approach: 1. First, enable leak detection and reporting without failing builds 2. Fix identified leaks in both test and production code 3. Eventually, enable strict enforcement where CI builds would fail when leaks are detected This approach will allow us to establish a clean baseline and create an automated safety net that prevents future regressions in Netty buffer management. By catching these issues early in the development cycle, we can significantly improve system stability and resource efficiency in production environments. ### Modifications - Added a custom `ExtendedNettyLeakDetector` implementation that extends Netty's `ResourceLeakDetector` - Configured leak detection to output detailed reports to files in a designated directory (`NETTY_LEAK_DUMP_DIR`) - Added reporting steps to all CI workflows to display leaks in GitHub Actions UI - Updated container configurations to pass appropriate system properties for leak detection - Modified build configurations to enable leak detection with appropriate settings - Enhanced `PulsarTestListener` to trigger leak detection at key test lifecycle events - Added capability to collect and report leaks from integration tests ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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]
