Repository navigation
fix(memory): stop the process-lifetime leaks -- fixed-cardinality DDL metrics, metrics registry released on stop and reinitialize, worker connections closed with the pool, one binlog-position gauge child (Spec 10.03 section 3.4, Spec 01.01 section 3.3 step 4a) - #1506
Merged
Merged
Conversation
… counter carried the statement text and a wall-clock timestamp as tags (one series per DDL event, never removed), each engine restart built a new metrics registry without closing the old one (its JvmGcMetrics listeners kept every series reachable), and discarded workers never closed their per-database and system connections; also one binlog-position gauge child instead of one per rotation (Spec 10.03 section 3.4, Spec 01.01 section 3.3 step 4a)
… -- the superclass constructor opens the system connection before the subclass's field initializers run
This was referenced Sep 26, 2026
minguyen9988
added a commit
that referenced
this pull request
Sep 27, 2026
…thrown -- since the registry is released on stop() (#1506), updateCounters/updateErrorCounters/updateDdlMetrics registered through a null reference between stop() and the next initialize() and threw NullPointerException out of the write path (Spec 10.03 section 3.4 item 4) (#1517) The three counter updates now check that metrics are enabled and the meter registry is present and not closed before registering; an increment that arrives with no registry has nowhere to be scraped from and is dropped. This restores the behaviour the leaked registry used to provide by accident, without the leak. Observed: the sink-connector module runs its whole suite in one JVM (forkCount=0). When MetricsContentTypeTest / MetricsLifecycleTest run before db.batch.*, eleven PreparedStatementExecutor tests fail with NullPointerException: Cannot invoke MeterRegistry.counter(Meter$Id) because "registry" is null. The order depends on the file system, so CI stayed green while a local run went red. Test: MetricsLifecycleTest.counterUpdatesAfterStopAreDroppedNotThrown -- red with NullPointerException when the guard is removed from any of the three updates, green with it; the next initialize() counts again from zero. Spec: 10.03 section 3.4 item 4, section 5.
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.
Independent of #1504 and #1505 (branches from the 2.11.0 head directly).
Defects
Three structures grew for the life of the process on a fixed heap, with no relation to the current workload:
Rule (spec 10.03 section 3.4; spec 01.01 section 3.3 step 4a)
Checks on this branch