fix: PCMetrics memory leak from duplicate meter registrations (#859)#45
fix: PCMetrics memory leak from duplicate meter registrations (#859)#45astubbs wants to merge 0 commit intocherry-pick/905-max-shard-metricfrom
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
✅ Duplicate Code ReportTwo engines run in parallel for cross-validation. Each has its own thresholds tuned to its baseline - the real safety net is the per-engine "max increase vs base" check. ✅ PMD CPD
No new clones introduced by this PR. ✅ jscpd (language-agnostic)
No new clones introduced by this PR. Powered by astubbs/duplicate-code-cross-check |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## cherry-pick/905-max-shard-metric #45 +/- ##
======================================================================
+ Coverage 77.06% 77.17% +0.11%
- Complexity 1154 1155 +1
======================================================================
Files 82 82
Lines 4195 4198 +3
Branches 387 387
======================================================================
+ Hits 3233 3240 +7
+ Misses 769 765 -4
Partials 193 193
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
❌ Mutation Testing (PIT) ReportPIT did not produce a report. Most commonly this means a test failed in the baseline (PIT runs all tests unmodified first to establish green) and PIT aborted before mutating. See the "Run PIT mutation testing" step logs for the failing test, then either fix it or add it to |
5fa45f5 to
32ba213
Compare
f120e8d to
a751003
Compare
32ba213 to
0be2aef
Compare
a751003 to
febbc72
Compare
0be2aef to
f63e753
Compare
febbc72 to
ac415f8
Compare
f63e753 to
e4693a0
Compare
ac415f8 to
f1ad1da
Compare
e4693a0 to
f125b26
Compare
f1ad1da to
673869a
Compare
|
f125b26 to
5476dc4
Compare
673869a to
5476dc4
Compare
Summary
Fixes confluentinc#859:
PCMetricsregistered new Micrometer meters on every partition assignment without closing/removing the old ones. Over time this leaked memory proportional to the number of rebalances.PartitionState,PartitionStateManager)PCMetricsTest859— regression test that triggers multiple rebalances and verifies meter count stays boundedCherry-picked from the original
bugs/859-pcmetrics-memory-leakbranch (commitsdcd98b05,b25790cf), rebased cleanly onto the PR chain.depends on #43
Test plan
PCMetricsTest859passes (new regression test)PCMetricsTestpasses (existing metrics tests)🤖 Generated with Claude Code