Repository navigation
Fix executor metrics lifecycle - #321
Merged
Merged
Conversation
Close RocksDB and AgentHost executors and remove their meters. Remove Raft and range executor meters on shutdown. Release manager meters before range destruction completes. Keep snapshot dump metrics under a separate name. Add tests for shutdown, range split, destruction, and replacement.
Use range tags to give each delay and delivery executor its own meters. Remove those meters when the owner closes. Keep DelayTaskRunner.shutdown synchronous. Cancel pending triggers and wait for the executor to terminate before returning. Add tests for meter ownership and synchronous shutdown.
liaodn
approved these changes
Oct 27, 2026
liaodn
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Approved.
Always stop the test group so later tests can create nodes with the same metric identity.
liaodn
approved these changes
Oct 27, 2026
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.
After reviewing #290 and PRs #293 and #320, I found that the problem goes beyond the RocksDB compactor. Other executors also leave meters behind after shutdown, and some pools share the same metric names and tags.
This patch adds
MonitoredExecutorsto clean up meters on shutdown, which Micrometer'sExecutorServiceMetricsdoes not do automatically. It also fixes the RocksDB and AgentHost shutdown paths and separates snapshot dump metrics from FSM metrics. Process-wide pools keep their existing monitoring.