Skip to content

ripr review-guidance pass dies by SIGTERM (oomd-class) on ~1700-file closures: peak memory scales with closure size #3768

Open

Description

@EffortlessSteven

Observed from the perl-lsp-swarm CI consumer (6 dispatches, 2026-09-17/18)

Every ripr-review-comments invocation on a large-closure PR (1600–1700 indexed Rust files) dies mid-pass with exit code 143 (SIGTERM), while all smaller closures complete normally.

Measured terminations (github-hosted ubuntu-24.04, 4-core/16GB)

guidance duration configured bound at the time notes
20m10s 1800s bound NOT reached — killed early
29m08s 3600s bound NOT reached — killed early
26m21s 3600s bound NOT reached; no runner-shutdown line in the log
65-80m job deaths various sibling lanes cancelled mid-run in the same windows

Durations match no configured bound. In the drained-window failure there was no runner has received a shutdown signal line — the process group was TERMed silently ~20-30 minutes into the pass. The analysis stage (ripr-pr diff analysis, capped in a docker container) succeeds on the same closures every time; it is specifically the review-guidance stage that dies.

Diagnosis

The signature — variable time-to-death on large closures only, silent SIGTERM, no shutdown marker — fits memory-pressure termination (systemd-oomd TERMs the cgroup on the 16GB hosted runner before the runner-level shutdown marker ever appears). Peak memory of the review-guidance pass appears to scale with the full closure index rather than staying bounded like the analysis stage. That is consistent with ripr's own design intent elsewhere: RIPR_MAX_DIFF_INDEX_FILES exists precisely so the analysis never exhausts host memory — but the guidance stage appears to rebuild or hold an unbounded index of its own.

Request

  1. Make the review-guidance stage's peak memory bounded (chunked guidance windows over the diff closure, or persist/reuse the analysis stage's diff-scoped index instead of rebuilding).
  2. If a memory ceiling is intentional, expose it as a named error (like diff_scope_oversized) so CI can classify the failure instead of failing closed on an unretrievable-log/incomplete-receipt path.

Consumer-side context: perl-lsp-swarm required gate ripr+ New Gap Gate fails closed when the guidance receipt is incomplete (review_guidance.status = incomplete), so these PRs cannot merge until either the pass completes or the classification distinguishes instrument-failure from real gaps. Full evidence trail: EffortlessMetrics/perl-lsp-swarm#15498 (comments 5731363284, 5733075958), #15837, #15857, #15863.

Activity

  1. EffortlessSteven commented on Sep 18, 2026

    @EffortlessSteven
    MemberAuthor

    Fifth measured termination (probe re-dispatch after a repository directive to stay on github-hosted runners — no capacity change observed server-side): guidance started 17:44:24Z, killed 18:12:17Z — 27m53s, no runner-shutdown line, same silent SIGTERM. The termination durations across six runs now span 20m10s–29m08s, all well inside the configured bounds (1800s/3600s), confirming the bound is not the limiter and the pass is being terminated externally ~20-30 minutes in on ~1700-file closures — consistent with the memory-pressure diagnosis above.

    Consumer note: if a larger github-hosted runner is enabled at the org level (Settings → Actions → Runners), a one-line runs-on label change in the consumer's ripr workflow would immediately give this pass more headroom; otherwise the bounded-guidance fix from the request above is the path.

  2. EffortlessSteven commented on Sep 18, 2026

    @EffortlessSteven
    MemberAuthor

    Design pointer found in the 0.10.0 CLI itself: ripr review-comments --gap-ledger PATH — per its own help text, 'when --gap-ledger is supplied, it does not rerun analysis; it renders only eligible PR-local repair cards from explicit GapRecord records.' That is exactly the bounded shape this issue asks for: guidance becomes a cheap render over explicit GapRecords instead of a full re-index of the closure.

    The consumer currently cannot use it because (a) cargo xtask ripr-review-comments does not expose --gap-ledger, and (b) the CI analysis stage (ripr-pr) does not emit a GapRecord ledger — gap-decision-ledger.json today is produced by the swarm tooling (ripr swarm queue), not by the plain diff pipeline.

    Suggested upstream shape: have the diff analysis stage optionally emit GapRecords (it has already computed everything the guidance needs), expose --gap-ledger through the xtask wrapper, and the hosted guidance stage drops from a ~1700-file re-index (OOM) to a bounded render. Until then the consumer's four large-closure PRs stay blocked on the hosted-lane terminations documented above.

  3. EffortlessSteven commented on Sep 18, 2026

    @EffortlessSteven
    MemberAuthor

    Sixth measured termination refines the diagnosis — the killer is almost certainly systemd-oomd managed kill, not a configured bound anywhere in the stack:

    Solo-window probe (only ripr chain running on the runner pool): guidance ran 20:04:05Z → 20:33:17Z = 29m12s, then exit code 143 (SIGTERM), silent, no runner-shutdown line. Consumer-side verification of the invoking wrapper (run_output_with_timeout) shows its own 3600s watchdog kills the CHILD with SIGKILL and exits with a named 'timed out after 3600s' error — the observed signature (parent cargo xtask TERMed at 143, no error text) cannot come from that path. On github-hosted ubuntu runners, systemd-oomd in managed-kill mode TERMs the cgroup's processes under sustained memory pressure — matching every observation: silent, variable 20-29m (time-to-sustained-pressure on ~1700-file closures), only the largest closures affected, smaller closures unaffected.

    Conclusion for the fix design: no timeout configuration on the consumer side can help — the pass needs its peak memory bounded (chunked guidance windows / GapRecord-ledger render via --gap-ledger, per the design pointer above) or a larger-memory runner. Measured durations across all probes: 20m10s, 26m21s, 27m53s, 29m08s, 29m12s.

  4. EffortlessSteven commented on Sep 18, 2026

    @EffortlessSteven
    MemberAuthor

    Staggered-dispatch measurements sharpen the termination profile: with ripr chains dispatched 25-40 minutes apart (near-solo windows), guidance died at 29m12s (20:04:05→20:33:17) and 29m20s (20:43:23→21:12:43) — and a source audit of ripr 0.10.0 finds no internal timeout, budget, or signal use in the review-comments path, while the consumer's own 3600s watchdog demonstrably never fired (it would exit with a named 'timed out after 3600s' error, not 143).

    So the termination is external to both ripr and its consumer at a consistent ~29-30 minutes on ~1700-file closures: platform-level reaping of the long-running process (the runner-shutdown marker appears in some rounds, not others). Combined across seven dispatches: 20m10s, 26m21s, 27m53s, 29m08s, 29m12s, 29m20s — the deaths cluster at the top of a ~20-30m band and never exceed it.

    Practical consumer consequence: the pass must complete inside ~20 minutes to survive reliably — which the bounded-guidance redesign (chunked windows / --gap-ledger render, design pointer above) would deliver, or the stage must move to infrastructure without the ~30m reaper.

  5. EffortlessSteven commented on Sep 25, 2026

    @EffortlessSteven
    MemberAuthor

    Production data point from perl-lsp-swarm's required ripr+ gate (rip r v0.10.0 pinned, 1,700+-file workspace, GitHub-hosted ubuntu-24.04 4-core, docker 14g):

    • The guidance pass's memory/cost scaling matches your oomd SIGTERMs: we observe the same class of silent death (runner shutdown / lost-comms evictions at 49–132m) once a PR adds ≳2,000–3,000 lines (empirical flip zone: +1,991 lines passes at 60m total; +2,636 lines fails). Below the flip zone, guidance is ~1s after a ~58m fixed floor; above it, guidance runs 20–70m+ and the job dies before completing.
    • The fixed floor is size-independent: Build xtask ~6m + PR analysis ~12m + repo-wide baseline receipt ~40m, before guidance starts — so guidance gets whatever headroom remains under the 135m job envelope, and the 3600s --timeout-seconds bound is empirically unreachable (evictions arrive first; zero 3600s SIGTERMs observed in 424 runs since 09-15, all exit-143s are runner-side).
    • Chunked guidance over the diff closure, or the gap-ledger consumption path (analysis emits a GapRecord ledger; guidance renders from it with zero analysis) would fix this class for us without raising consumer timeouts further.

    Happy to provide run/job IDs and step timings if useful — 424 failed runs measured in the last 10 days.

  6. EffortlessSteven commented on Nov 2, 2026

    @EffortlessSteven
    MemberAuthor

    Cursor claim: verifying #3768 against main, then fixing if still open.

  7. EffortlessSteven commented on Nov 2, 2026

    @EffortlessSteven
    MemberAuthor

    Cursor verify — origin/main 7a8d76e958b96ab1e89b5a5a2f947e3b7ab4593a

    Verdict: already-done for this issue’s two request items. Tests already pin the behavior, so no PR. Not closing the issue from this pass.

    Request 1 — bound review-guidance peak memory (chunked windows or reuse the analysis index)

    Landed as chunked evidence windows plus an intentional file/byte admission ceiling below the measured 1,600–1,700-file death band.

    Item Evidence on 7a8d76e958 Delivered by
    Default file ceiling 1200 (below the ~1700-file SIGTERM shapes) crates/ripr/src/cli/commands/review_comments.rs:37-45 (REVIEW_GUIDANCE_MAX_INDEX_FILES_DEFAULT = 1200); docs/CONFIGURATION.md RIPR_REVIEW_GUIDANCE_MAX_INDEX_FILES PR #4969 squash 225f241d2e
    Admission before owner indexing / corpus materialization :700-745 (corpus_admission then ceiling.enforce) PR #4969
    Default ceiling admits 1200 and refuses 1700 :3303-3330 guidance_payload_default_admits_current_family_but_refuses_failure_scale PR #4969
    Chunked guidance windows (default 32, 1–256) crates/ripr/src/analysis/seam_inventory.rs:2232-2314 (RIPR_REVIEW_EVIDENCE_WINDOW_SIZE, classify_evidence_windows) PR #5001 merge 61c377fcfe / e4a3eaa3f7
    Window parity + retained-payload bound crates/ripr/tests/cli_smoke.rs:34285 review_guidance_windows_preserve_output_and_bound_retained_payloads PR #5001
    Git-range diff stdout bounded to the same payload ceiling review_comments.rs:1096-1142 → load_diff_range_with_deadline_and_git_stdout_limit_core PR #12384 d2faffceec

    Request 2 — named classifiable ceiling error (not silent SIGTERM / incomplete-receipt)

    Item Evidence on 7a8d76e958 Delivered by
    Named producer prefix review_guidance_oversized review_comments.rs:65-69, :108-140 GuidancePayloadCeiling::enforce PR #4969
    Receipt category constant crates/ripr/src/output/review_comments_receipt.rs:13-16 PR #4969
    Over-ceiling dispatch writes status=failed + category, publishes no guidance JSON/Markdown review_comments.rs:3437-3491 review_comments_refuses_over_ceiling_closure_with_named_receipt PR #4969
    xtask wrapper classifies producer stderr as instrument-limited, not a real gap xtask/src/reports/review_comments.rs:1031-1055, :1879 write_wrapper_classifies_named_guidance_ceiling_failure PR #4969
    Spec docs/specs/RIPR-SPEC-0012-pr-test-guidance.md:85-97 PR #4969

    What this does not claim (owned elsewhere; not a remaining #3768 request item)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions