Skip to content

Oom leaks rollout fallback - #7

Merged
jkremser merged 4 commits into
mainfrom
oom-leaks-rollout-fallback
Sep 25, 2026
Merged

jkremser merged 4 commits into
mainfrom
oom-leaks-rollout-fallback

Conversation

@jkremser

Copy link
Copy Markdown
Member

No description provided.

Use one hour of measured history and distinct observation timestamps,
with coverage guards that tolerate collection gaps. Expose shared sample
normalization and versioned decision traces.

Fall back to qualifying usage from up to three earlier rollouts while
retaining current identity, allocation, and inventory guards. Initialize
known-unset settings without material-change thresholds.

Update the output schema, fixtures, regression tests, and caller guidance.
Normalize and deduplicate release-scoped OOM events, and use failed limits
or explicit fallback allocations to establish a memory request floor.
Allow justified growth without usage history while retaining identity,
freshness, bounds, and allocation consistency guards.

Report OOM evidence and sizing adjustments in results and decision traces.
Cover interactions with rollout fallback and unset settings, update the
policy fixture, and document event normalization for adapters.
Detect sustained growth in bucketed memory baselines using bounded robust
trend analysis, with warmup, coverage, freshness, and recent-growth guards.
Keep replicas and container lifetimes separate and correlate OOM events
with individual episodes.

Expose normalized policy and advisory findings without changing resource
recommendations. Add regression coverage for growth, plateaus, recovery,
insufficient evidence, identity boundaries, and deterministic output.
Document configuration, evidence, and interpretation limits.
Copilot AI lite review requested due to automatic review settings September 24, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Moderate correctness issues remain in trace reasons, leak coverage accounting, and OOM validation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 6 Low severity

Open (7)
What changed in this PR

Adds OOM-aware sizing, rollout fallback, unset-setting handling, decision traces, sample normalization, and optional memory-leak diagnostics.

Changes:

  • Adds OOM evidence and guarded memory adjustments.
  • Implements rollout fallback, unset handling, and leak detection.
  • Updates schemas, documentation, normalization, and tests.
File Summary
README.md Documents new analysis capabilities and contracts.
analysis/​unset_test.go Tests unset allocation handling. Nit: add the standard header.
analysis/​types.go Adds input, policy, evidence, and output types.
analysis/​trace.go Defines decision-trace structures. Nit: add the standard header.
analysis/​trace_test.go Tests decision traces and normalization. Nit: add the standard header.
analysis/​testdata/​default-output.json Updates expected output schema and trace data.
analysis/​samples.go Normalizes raw samples. Nit: add the standard header.
analysis/​oom.go Implements OOM selection and adjustments. Moderate: validate and deduplicate all observations before time-window filtering.
analysis/​oom_test.go Tests OOM behavior and validation.
analysis/​memory_leak.go Implements leak detection. Moderate: account for empty or stale series so missing coverage does not produce a false no-leak result.
analysis/​memory_leak_types.go Defines leak policies and result types.
analysis/​memory_leak_test.go Tests leak detection behavior.
analysis/​fallback.go Implements previous-rollout usage fallback. Nit: add the standard header.
analysis/​fallback_test.go Tests rollout fallback behavior. Nit: add the standard header.
analysis/​analyze.go Integrates fallback, OOM, unset, and trace logic. Moderate: use per-entry missing/stale reasons in the request trace.
analysis/​analyze_test.go Tests sizing, normalization, and analysis behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread analysis/analyze.go Outdated
Comment thread analysis/fallback.go
Comment thread analysis/fallback_test.go
Comment thread analysis/samples.go
Comment thread analysis/trace.go
Comment thread analysis/trace_test.go
Comment thread analysis/unset_test.go
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Copilot AI review requested due to automatic review settings September 25, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical fallback and public API compatibility issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (7)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Preserve current validation failures in fallback quality

analysis/​fallback.go:64

current is passed into this function before analyzeResource validates current request/limit freshness and inventory (those checks occur later in analyze.go). Consequently, a selected fallback's rolloutFallback.currentDataQuality omits those current-rollout failures even though the public contract says it preserves the failed current checks. Capture the completed current quality, or otherwise merge the later guard reasons, before populating this field.

Comment thread analysis/fallback.go
Comment thread analysis/types.go
@zroubalik
zroubalik requested a balanced review from Copilot September 25, 2026 13:07
@jkremser
jkremser merged commit 48832c5 into main Sep 25, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

No-usage safety retention is incorrectly reported as bounds enforcement, and sample-count documentation conflicts with implementation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
Resolved since last review (2)

Comment thread analysis/analyze.go
Comment on lines +333 to +338
if usageBlocked {
suggestedRequest = math.Max(suggestedRequest, obs.CurrentRequest.Value)
}
requestTrace.step("request bounds", map[string]float64{"before": rawSuggestedRequest, "minimum": bounds.Minimum, "maximum": bounds.Maximum, "candidate": suggestedRequest})
requestBounded := suggestedRequest != rawSuggestedRequest
boundsSuppressedAction := requestBounded && isMaterial(obs.CurrentRequest.Value, rawSuggestedRequest, bounds) && !isMaterial(obs.CurrentRequest.Value, suggestedRequest, bounds)
boundsSuppressedAction := requestBounded && isMaterial(obs.CurrentRequest, rawSuggestedRequest, bounds) && !isMaterial(obs.CurrentRequest, suggestedRequest, bounds)
Comment thread analysis/analyze.go
Comment on lines +349 to +355
if usageBlocked && limitOK {
suggestedLimit = math.Max(suggestedLimit, obs.CurrentLimit.Value)
}
limitTrace.step("request × limit ratio", map[string]float64{"request": suggestedRequest, "ratio": ratio, "candidate": rawSuggestedLimit})
limitTrace.step("limit bounds", map[string]float64{"before": rawSuggestedLimit, "minimum": suggestedRequest, "maximum": bounds.Maximum, "candidate": suggestedLimit})
limitBounded := suggestedLimit != rawSuggestedLimit
boundsSuppressedAction = boundsSuppressedAction || limitOK && limitBounded && isMaterial(obs.CurrentLimit.Value, rawSuggestedLimit, bounds) && !isMaterial(obs.CurrentLimit.Value, suggestedLimit, bounds)
boundsSuppressedAction = boundsSuppressedAction || limitOK && limitBounded && isMaterial(obs.CurrentLimit, rawSuggestedLimit, bounds) && !isMaterial(obs.CurrentLimit, suggestedLimit, bounds)
Comment thread README.md
Comment on lines +52 to +54
`sampleCount` reports all distinct per-series samples; `observationCount` reports
distinct timestamps across series after normalization (including CPU counter
conversion) and is the count checked against `minimumSamples`. Confidence uses unique release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants