[fix][test] Restore NETTY_LEAK_DETECTION for Gradle and CI tests - #26605
Merged
Merged
Conversation
Enable ExtendedNettyLeakDetector with the branch-4.2 paranoid defaults and restore the testLeakDetectionLevel and testExitJvmOnLeak options. Honor NETTY_LEAK_DETECTION=off and keep test profiling free of leak-detection overhead. Document local and CI usage. Validated with quickCheck, assemble, a scoped buildtools test, configuration-cache reuse, and an isolated intentional ByteBuf leak probe covering default/report/fail_on_leak/off modes, level overrides, profiling, and JVM exit on leak. Assisted-by: Codex
Pass the selected leak-detection mode and dump directory to integration and system jobs, collect their leak reports, and preserve dumps as artifacts. Read container leak archives from the Gradle build directory instead of the obsolete Maven target directory. Validated workflow wiring and shell syntax, plus report and fail_on_leak exit statuses using both actual JVM leak dumps and container log archives. Assisted-by: Codex
Collect Pulsar container logs after graceful service shutdown and before container removal so ExtendedNettyLeakDetector shutdown-hook reports are retained. Preserve cleanup if stopping or collecting logs fails. Add live Docker regressions for standalone and supervisor-managed JVMs, and run them in the standalone suite. Both reproduce missing shutdown reports before the fix and pass afterward. Add eight CI collector cases for host-only, container-only, combined, and clean runs in report and fail_on_leak modes. Validation: Docker test image build, scoped integration tests with configuration-cache reuse, Python collector regression tests, unit/integration/system workflow wiring checks, and quickCheck. Assisted-by: Codex
Remove the Python regression script and its CI step to keep leak-detection support focused on the existing Gradle and Docker test infrastructure. Assisted-by: Codex
merlimat
approved these changes
Sep 16, 2026
dao-jun
approved these changes
Sep 16, 2026
lhotari
marked this pull request as draft
September 16, 2026 17:16
Member
Author
|
Blocked by this lightproto issue: streamnative/lightproto#21 |
10 tasks
lhotari
marked this pull request as ready for review
September 17, 2026 11:21
lhotari
marked this pull request as draft
September 17, 2026 11:22
lhotari
marked this pull request as ready for review
September 17, 2026 14:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The Gradle migration dropped the test JVM settings that enabled
NETTY_LEAK_DETECTIONinbranch-4.2. The CI controls and custom detector remained, but tests no longer used the detector by default. Integration and system jobs also lost their leak-report collection steps.Container logs were copied before graceful service shutdown, so leak reports produced by the detector's JVM shutdown hook could be lost when the container was removed.
Modifications
ExtendedNettyLeakDetectorand paranoid detection for Gradle tests, includingNETTY_LEAK_DETECTION=off, leak-level and exit-on-leak options. Disable detection during test profiling and document local usage.build/container-logspath.Verifying this change
Local validation passed:
./gradlew spotlessCheck checkstyleMain checkstyleTest,quickCheck, andassemble.NettyLeakDetectionTestagainst a locally built Docker test image. Both shutdown modes fail on missing reports before the collection fix and pass afterward with realByteBufleaks.Does this pull request potentially affect one of the following parts: