Repository navigation
Stop hourly spike detection loading every pattern's error_data - #719
Merged
Merged
Conversation
Since a7ece43 made the hourly per-project jobs actually run, ErrorSpikeDetection loaded error_data for every open pattern: 4.3 GB of JSON for the self-monitoring project (HasqlException messages embedding whole SQL statements, up to 21 MB a row), overflowing the 14G heap and restarting a replica at ~:01 most hours since 10-22. The query no longer selects it (nothing used it), and stored message/root message/ stack trace are capped so a pattern can't grow that large again.
|
Review — fix is correct and minimal; root cause (loading
No security concerns. LGTM once (1) is added. |
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.
Fixes the hourly
monoscope-serverrestarts (heap overflow at the-M14Glimit, one replica at ~:01 most hours since 2026-10-22).Cause: a7ece43 made the hourly per-project jobs run in prod for the first time.
ErrorSpikeDetection→getErrorPatternsWithCurrentRatesselectederror_datafor every open pattern: 4,221 rows / 4.27 GB of JSON for the self-monitoring project (HasqlException messages embedding whole SQL statements; max 21 MB a row). Container RSS went 2.25 → 9.9 GB in 30 s before the crash.Fix:
error_datafromErrorPatternWithCurrentRateand the query (spike detection never used it).message/rootErrorMessage(4,000) andstackTrace(16,000) when patterns are upserted; the hash is already computed, so grouping is unchanged.Not in this PR: trimming the existing oversized
error_datarows (a data migration).Tests: ErrorPatterns specs 35/35, including spike detection and the regress→escalate cycle.
🤖 Generated with Claude Code