Public: anyone can read this; the crew can change it.

Sentinel: snapshot-failed was degraded 33 minutes today: The last snapshot failed: list chunks/ failed after 5 attempts: an unexpected error has occurred. The newest that lande… #17863

opened this

Merged 28h 46m ago, live in production

A snapshot failure that clears within an hour no longer raises the snapshot-failed card while a snapshot under 30 hours old exists. I ran only bun test test/snapshot-outcome.test.ts (7 pass), bun x tsc --noEmit and bun scripts/gate.ts --fix. The forge's full check runs on this push.

Notes

opened this

A snapshot failure that clears within an hour no longer raises the snapshot-failed card while a snapshot under 30 hours old exists. I ran only bun test test/snapshot-outcome.test.ts (7 pass), bun x tsc --noEmit and bun scripts/gate.ts --fix. The forge's full check runs on this push.

Why: the card appeared on the first failed nightly snapshot and stayed until a retry landed. Here the store's list chunks/ call kept erroring for 33 minutes and then cleared, while last night's snapshot was already safe. Nobody needed to act, but the card counted as degraded time.

What changed: snapshotNeed in src/snapshot/outcome.ts now takes now. It stays quiet when both are true:

  • The failure is under SNAPSHOT_GRACE_MS (60 minutes, about six retries).
  • The newest snapshot that landed is under SNAPSHOT_LEAN_MS (30 hours) old.

If the failure outlasts the hour, or the newest landed snapshot is older than 30 hours, or none ever landed, the card shows at once, as before. The existing service test that expects an immediate card still holds because it has no earlier snapshot.

Tests: two new tests in test/snapshot-outcome.test.ts cover the 33-minute case, the card after the grace, and the card when the newest snapshot is old.

Not done: I did not touch the 10-minute retry or the store's five-attempt retry. The "backup late" cards still cover a store that stays dead. The listing error itself, a flaky answer from the bucket, is not fixed.

Doors: no page, action or tool changed. The terminal reads the same needs through forgeNeeds, so it shows the same card at the same time. The commit says No door: with that reason.

To try: record a landed snapshot from yesterday, then a failure from 30 minutes ago. /settings/backups and the vitals show no card until the failure is an hour old.

Closes #17862

commented

A snapshot failure that clears within an hour no longer raises the snapshot-failed card while a snapshot under 30 hours old exists. I ran only bun test test/snapshot-outcome.test.ts (7 pass), bun x tsc --noEmit and bun scripts/gate.ts --fix. The forge's full check runs on this push.

Why: the card appeared on the first failed nightly snapshot and stayed until a retry landed. Here the store's list chunks/ call kept erroring for 33 minutes and then cleared, while last night's snapshot was already safe. Nobody needed to act, but the card counted as degraded time.

What changed: snapshotNeed in src/snapshot/outcome.ts now takes now. It stays quiet when both are true:

  • The failure is under SNAPSHOT_GRACE_MS (60 minutes, about six retries).
  • The newest snapshot that landed is under SNAPSHOT_LEAN_MS (30 hours) old.

If the failure outlasts the hour, or the newest landed snapshot is older than 30 hours, or none ever landed, the card shows at once, as before. The existing service test that expects an immediate card still holds because it has no earlier snapshot.

Tests: two new tests in test/snapshot-outcome.test.ts cover the 33-minute case, the card after the grace, and the card when the newest snapshot is old.

Not done: I did not touch the 10-minute retry or the store's five-attempt retry. The "backup late" cards still cover a store that stays dead. The listing error itself, a flaky answer from the bucket, is not fixed.

Doors: no page, action or tool changed. The terminal reads the same needs through forgeNeeds, so it shows the same card at the same time. The commit says No door: with that reason.

To try: record a landed snapshot from yesterday, then a failure from 30 minutes ago. /settings/backups and the vitals show no card until the failure is an hour old.

commented

I've fixed the blocker and pushed. The "When a snapshot fails" section of docs/SNAPSHOT.md now matches what the code does. bun x tsc --noEmit, the gate and test/snapshot-outcome.test.ts (7 pass) are green. The forge's full check runs on this push.

What the section says now:

  • The red line on the Backups page still shows at once. That page doesn't go through snapshotNeed.
  • The board card and the terminal's dashboard needs wait out SNAPSHOT_GRACE_MS (one hour) while the newest snapshot that landed is under SNAPSHOT_LEAN_MS (30 hours) old.
  • The card shows at once when the newest landed snapshot is 30 hours old or older, or when none has ever landed.

Also changed: I added the one-line comment above the NaN case in src/snapshot/outcome.ts saying that a never-landed snapshot makes the comparison false, so the card shows. I kept the constants' comment about the 33-minute flake.

I made no other code changes, and I ran no similar.ts check because I added no new function.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs