Repository navigation
Conversation
… recovery loop A renderer that crashes on every startup (e.g. GPU-related STATUS_BREAKPOINT on some Windows NVIDIA setups) was reloaded every cooldown interval forever, burning thousands of crash events per day while the never-shown window left the app stuck at launch. Stop automatic recovery after 5 consecutive reloads that never survive the 30s recovery window; a renderer that stays up past the window resets the counter so normal recovery behavior is unchanged.
There was a problem hiding this comment.
AIUO CodePilot · Preliminary review
Diff-only preliminary review of renderer crash-recovery cap and its tests. The main-process logic correctly limits consecutive reloads and resets after a healthy window; one test ordering issue is reported below. Verification is limited to the supplied diff and test text: no repository access, execution, or runtime checks were performed.
- medium
apps/desktop/test/renderer\-recovery\.test\.mjs:120: The test asserts `i < 5` for the return value of `recoverRendererAfterGone` on every iteration, but each `recovery()` call constructs a fresh dependencies object with its own reload callback; the module-level `consecutiveReloads` counter is what enforces the cap, and the assertion assumes reload count increments before the cap check. After the fifth successful reload the sixth call returns false, so `assert.equal(..., i < 5)` holds only if the counter increments exactly once per attempt including attempts skipped by the cooldown delay. Because `mock.timers.tick(2_100)` occurs after the assertion and the cooldown branch schedules rather than performs reloads immediately, this assertion ties correctness to timing details not visible in the diff; if `elapsed < CRASH_COOLDOWN_MS` defers the reload while still incrementing `consecutiveReloads`, the returned value and the intended recovered count may diverge from the test's expectation.
Evidence:assert\.equal\(recoverRendererAfterGone\(details, attempt\.dependencies\), i < 5\);
Head: 1dc6271
Base: 720bbe1
CI: pending; mergeable: true.
Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.
|
Heads-up: I independently filed #2597 against the same issue (#2595) — the two overlap and combine cleanly. Your cap (5 reloads, 30s recovery window, counter reset) and the breaker in #2597 are the same idea; #2597 then adds what happens after the cap trips, which is the part the #2595 reporter is still blocked on: a first-trip relaunch with Also FYI: your CI failure is not your change — Happy to land this either way: I can rebase #2597's escalation on top of your cap (your reset heuristic is nice and self-contained — no |
|
Thanks for the heads-up, and good catch on the CI flake — agreed it's the undici real-socket flake, unrelated to the cap change. On coordination: no preference on our side, maintainer's choice. Both options work for me — if #2597 lands first I'll rebase #2600 on top; if #2600 merges first, folding the escalation in with authorship preserved sounds right. The cap is intentionally self-contained (no |
|
Thanks for coordinating with #2597. I checked the #2595 report against current I suggest keeping one breaker and carrying the bounded reload behavior into #2597 with your authorship preserved, as discussed. Please count actual reloads in the cap regression (instead of incrementing the test's own counter) and distinguish a renderer that stayed healthy from time after the breaker already stopped it. I left the fallback-path acceptance criteria on #2597. |
|
Per vastsa's direction, carried the bounded-reload behavior into #2597 rather than landing it here. Commit
Renderer recovery suite passes 10/10 locally ( With the bounded behavior carried over and the single-breaker decision made, closing this PR as superseded by #2597. |
Summary / 概要
Renderer crash recovery now stops after 5 consecutive reloads that never survive the 30s recovery window, instead of reloading every 2s forever.
On some Windows + NVIDIA setups the renderer crashes at startup (
renderer-process-gone,STATUS_BREAKPOINT), sorecoverRendererAfterGonereloaded the hidden window every cooldown interval indefinitely — users saw the app stuck on a black launch screen, and the host logged 10,000+ renderer crashes per day (see issue diagnostics comment).A renderer that stays up past the recovery window resets the counter, so normal transient-crash recovery is unchanged.
fixes #2595
Requirement link / 需求关联
fixes #2595