Skip to content

Commit 142ae49

Browse files
committed
revert(desktop): drop active cache-clear recovery, keep it passive + observable
Reviewer worry: clearing caches on every cooldown could amplify churn on a wedged device without helping the dominant crash cause (a GPU/V8 CHECK, exit 0x80000003), i.e. pour oil on the fire. Back the breaker off to "stop the loop + passive retry": on re-arm it reloads without mutating any device state and lets a transient fault clear on its own. The observability added alongside stays: a warn on breaker-open, an info per recovery attempt, and the bounded recovery-attempt analytics signal (recovery_attempt: N) so chronic loopers are still visible.
1 parent c64fe17 commit 142ae49

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

apps/desktop/src/main/runtime.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,23 +2404,19 @@ export async function createDesktopRuntime(options: DesktopRuntimeOptions): Prom
24042404
try {
24052405
// Crash-loop breaker open: park on the crash screen instead of reloading a
24062406
// deterministically-crashing renderer. Re-arm once the cooldown has
2407-
// elapsed with no further crash, then actively recover — clear the HTTP +
2408-
// V8 code caches (the most common recoverable cause is a corrupt cached
2409-
// bundle / shader, and this is non-destructive: no cookies or storage) and
2410-
// fall through for one reload attempt.
2407+
// elapsed with no further crash, then fall through for one reload attempt.
2408+
// The retry is intentionally PASSIVE: mutating a wedged device's state
2409+
// (clearing caches/storage) on every cooldown risked amplifying the churn
2410+
// without helping a GPU/V8-CHECK crash, so we only stop the loop and let a
2411+
// transient fault clear on its own. The attempt is still logged + counted
2412+
// so the recovery is observable.
24112413
if (rendererCrashLoop.isOpen()) {
24122414
if (rendererCrashLoop.rearmIfCooledDown(Date.now())) {
24132415
rendererRecoveryAttempts += 1;
24142416
console.info(
2415-
"[open-design desktop] renderer crash-loop cooldown elapsed — clearing caches and attempting recovery reload",
2417+
"[open-design desktop] renderer crash-loop cooldown elapsed — attempting recovery reload",
24162418
{ attempt: rendererRecoveryAttempts },
24172419
);
2418-
try {
2419-
await window.webContents.session.clearCache();
2420-
await window.webContents.session.clearCodeCaches({});
2421-
} catch {
2422-
// Best-effort: a failed cache clear must not block the reload attempt.
2423-
}
24242420
void reportRendererCrash(options, {
24252421
reason: "recovery-attempt",
24262422
exit_code: null,

apps/desktop/tests/main/renderer-crash-loop.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ describe("renderer crash-loop breaker wiring", () => {
119119
expect(runtimeSource).toContain("rearmIfCooledDown(");
120120
});
121121

122-
test("recovery actively clears caches before the retry reload", () => {
123-
// A passive reload alone can't escape a corrupt-cache crash, so the re-arm
124-
// path clears the HTTP + V8 code caches (non-destructive) first.
125-
expect(runtimeSource).toContain("session.clearCache()");
126-
expect(runtimeSource).toContain("clearCodeCaches(");
127-
});
128-
129122
test("breaker open and recovery attempts are observable via logs + bounded telemetry", () => {
130123
// A wedged device must be diagnosable: one warn on open, one info per
131124
// recovery attempt, and a bounded recovery-attempt analytics signal.

0 commit comments

Comments
 (0)