[hotfix][Metrics] Iterate a locked table-runtime snapshot in gauges - #4326
Draft
czy006 wants to merge 1 commit into
Draft
[hotfix][Metrics] Iterate a locked table-runtime snapshot in gauges#4326czy006 wants to merge 1 commit into
czy006 wants to merge 1 commit into
Conversation
…p gauges OptimizerGroupMetrics' five table-count gauges streamed over SchedulingPolicy's live HashMap on scrape threads without tableLock; concurrent addTable/removeTable (table onboarding, group migration) threw ConcurrentModificationException mid-scrape. getTableRuntimeMap() is @VisibleForTesting yet was the production access path. Add tableRuntimesSnapshot() (locked copy, same pattern as tableIdentifiersSnapshot) and point the gauges at it. Churn regression test: with the lock temporarily removed it fails 2 of 3 runs with CME; locked it is stable. Fix record: docs/fix-records/2026-08-16-fix-17-gauge-snapshot-cme.md
czy006
force-pushed
the
codex/hotfix-metrics-gauge-snapshot
branch
from
August 18, 2026 02:16
a2f0d14 to
e7c666d
Compare
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.
Brief change log
Make optimizer-group metric gauges iterate a scheduling-policy snapshot instead of the live runtime map. The snapshot is taken under the policy lock, preventing concurrent modification failures while metrics are scraped.
How was this patch tested?
TestSchedulingPolicylocally with JDK 11 before creating this pull request.Documentation