Public: anyone can read this; the crew can change it.
Sentinel: cloud-watch:digitalocean/prod was degraded 39 minutes today: The forge could not read digitalocean/prod to check it for stray machines (no answer in time); it is not known to be cl… #17861
Merged 32h 55m ago, live in production
When one DigitalOcean list read hung past the 30-second fetch limit, the whole cloud-watch reading failed. The duty then waited an hour before looking again, so /health showed cloud-watch:digitalocean/prod as degraded for up to an hour over a few seconds of trouble at the provider. This change fixes both halves.
-
Reviews
ApprovedApproved. Main already has the page retries and the ten-minute re-read. This pull adds what was missing. A held-back start closes the loop where an account whose credential will not open keeps its failed reading and runs the duty every tick. The health sentence now says "within ten minutes", which is true. The docs line is in docs/features/cloud.md, not the README. The test would fail without the change: it checks that a start 9 minutes after the failure holds the duty back, that it is due again at 19 minutes, and the new sentence. No new dependency, no dead code. The change is small and nothing in it touches the page or the terminal, so no
No door:line is needed. I opened the preview:/answers 200 with the landing page, and the change has no page of its own to look at, since it only alters a health sentence and the duty's schedule.Two things I would do next:
- src/cloud/watch_read.ts:93 still says "The watch reads the provider again within the hour" for orphans. That is true for a clean reading, but say so beside the ten-minute line, or the two sentences will drift.
- Make the credential-won't-open case a visible reading of its own. Today it keeps the old failed reading, so the card can show a stale error. Record a fresh failed reading with the reason, so the person sees why it keeps failing.
-
Checks
shipped production is serving it deploy a338207
-
History
- Merge main: keep #17859's page retries and ten-minute re-read, add the last-start bound and the true sentence (#17853) d01acd7
- Cloud account digitalocean/prod shows more than the forge made (#17857) 137546a
- Cloud account hetzner/prod shows more than the forge made (#17856) be9fa4e
- A repository can have its own account order, tried there without reordering the forge (#17843) 14bd626
- Sentinel: memory-growth was degraded 14 minutes today: The forge's own memory is 4774 MiB, over twice its first-hour 1779 MiB and past the 2176 MiB more its database caches m… (#17860) 8d72195
- Sentinel: backup was degraded 43 minutes today: Primary (s3.us-east-005.backblazeb2.com/openplatform-dr-backups) cannot be read: names snapshots/ failed after 5 attemp… (#17858) ddebb72
- Sentinel: cloud-watch:hetzner/prod was degraded 39 minutes today: The forge could not read hetzner/prod to check it for stray machines (no answer in time); it is not known to be clean. … (#17859) 5c2509f
- Cloud watch retries: rewrap comments, drop a stray blank line (#17853) 0b2f42c
- Cloud watch: a slow provider page is asked again, and a failed reading is retaken in 5 minutes (#17853) 3da8edc
- A Talk reply names its model, and a turn that reaches its limit says so and offers to go on (#17842) 01d8b2c
- Full suite red: test/page-titles.test.ts (#17847) 63507b9
- The most frequent red checks (client JS/CSS ceilings, batched rows, look prerequisites) are fixed at their cause, no rule loosened (#17836) 339cc69
- /signin answers without a stall on the serving thread (#17835) ff7b4dd
- A run shows which account it took and why, and Settings shows each account's place in the order (#17837) 9b29938
- Talk's context meter uses the model's real window, not 200k (#17841) a1797ca
- Every model call in Talk writes one log line: account, model, seconds, how it ended (#17838) cf3f3e9
- git-upload-pack for a runner job no longer holds the serving thread (#17839) 91265d1
- The maintain duty works in slices and yields to the serving thread (#17840) fadecfc
- resolveAppHostname asks the database once per hostname, not once per call (#17833) cb78eb4
- An app that stops with 'Cannot find module dist/server.js' says why on its page (#17834) 6c2baf3
When one DigitalOcean list read hung past the 30-second fetch limit, the whole cloud-watch reading failed. The duty then waited an hour before looking again, so /health showed cloud-watch:digitalocean/prod as degraded for up to an hour over a few seconds of trouble at the provider. This change fixes both halves.
What changed
- Each page gets three tries (
src/cloud/watch.ts,pages). Each try waits at most 10 s (PAGE_TRY_MS), with a 0.5 s and then a 1 s pause between tries. Only no answer in time, a dropped connection, 429 or 5xx is asked again. A 401, 403 or 404 is the real answer and is reported at once. A failure on every try reads as before ("no answer in time"). This also helps the other callers ofpagesinsrc/cloud/projects.ts. - A failed reading is taken again after 5 minutes, not the hour (
src/maintain/duties/cloud_watch.ts). The duty now has adueNow: it is due early when a watched account's last reading failed at leastRETRY_MS(5 min) ago. It also waits until 5 minutes after the duty's own last start, so an account whose credential won't open can't make it run every tick. The health sentence now says "It looks again within 6 minutes." - The duty gets its own 5-minute timeout. Three lists of three 10-second tries don't fit the runner's 30-second default.
- Its run budget goes from 30 to 120 a day, with the reason updated: room for about 8 hours of a provider not answering. These are read-only calls and cost nothing.
- Docs:
docs/features/cloud.mddescribes the tries and the retry.
What I chose not to do: hide a failed reading or wait for two in a row before reporting it. A provider that can't be read still raises the /health card at once. It just stands for minutes now, not the hour.
Reused: the runner's existing dueNow hook (as daily_proof uses it), lastStarted from src/maintain/runs.ts, and lastReading. No new dependency.
Tests:
test/cloud-watch-read.test.ts: a timed-out page is asked again and the list is read whole; a 503 is tried three times with 500 ms then 1000 ms pauses, then reported; a timeout on every try gives "no answer in time"; a 401, 403 or 404 is not retried.test/cloud-watch.test.ts: the duty is not due just under 5 minutes after a failure and is due at 5 minutes; a recent duty start holds it back; the new sentence; the try budget fits the duty's timeout; a clean reading stops the early runs.
Checks run: bun x tsc --noEmit is clean and the gate is green. The cloud-watch, cloud-projects, cloud-gate, maintain, vitals, notify, unused-exports and fetch-timeout suites pass. scripts/fast.ts named 510 files (about 36 minutes), so I picked the suites myself. A wider batch I started never finished: its tests were trying hosts the sandbox refuses (alpha--localhost, kid--localhost, homie--forge.test), so I have no result from it. The forge's full check covers it.
How to see it in production: after this is live, cloud-watch:digitalocean/prod should leave the degraded list within about 6 minutes of a failed read, or never appear for a single slow page.
🤖 Generated with Claude Code
While this pull waited, main already fixed the same problem for the hetzner twin of this issue (#17859). The merge keeps main's fix as it is and drops this branch's copy. This pull now adds only what main was missing: a guard against a fast-retry loop, a correct health sentence, and the matching docs.
What main already does (src/cloud/watch.ts, src/maintain/duties/cloud_watch.ts):
- Page retries: up to three tries of 15 s, 5 s and 15 s apart, on no answer in time, no connection, or a 429/502/503/504. Any other answer is reported at once.
- Faster second look: a failed reading is read again after 10 minutes instead of waiting for the next hourly run.
- Duty limits: a 10-minute timeout for the duty and room for 60 runs a day.
What this pull adds on top:
- Guard on the fast second look: it waits at least 10 minutes after the duty's last start. Without this, an account whose credential won't open keeps its failed reading, so on main the duty would run every minute until its daily budget ran out.
- Correct sentence: the
/healthsentence promised "It looks again within the hour", which stopped being true once main added the 10-minute second look. It now says "It looks again within ten minutes." - Docs:
docs/features/cloud.mddescribes the retries and the 10-minute second look. - Tests:
test/cloud-watch.test.tschecks that a recent duty start holds the second look back and lets it through 10 minutes later, and that the sentence says "within ten minutes".
Checks run: bun x tsc --noEmit and the gate are clean. The cloud-watch, cloud-projects, maintain-duty-states and unused-exports suites pass (39 tests). I picked these myself rather than running the whole suite.
How to see it in production: after a failed read of digitalocean/prod, its /health card should clear within about ten minutes once the provider answers again, not stay for the hour.
🤖 Generated with Claude Code
When one DigitalOcean list read hung past the 30-second fetch limit, the whole cloud-watch reading failed. The duty then waited an hour before looking again, so
/healthshowedcloud-watch:digitalocean/prodas degraded for up to an hour over a few seconds of trouble at the provider. This change fixes both halves.What changed
src/cloud/watch.ts,pages). Each try waits at most 10 s (PAGE_TRY_MS), with a 0.5 s and then a 1 s pause between tries. Only no answer in time, a dropped connection, 429 or 5xx is asked again. A 401, 403 or 404 is the real answer and is reported at once. A failure on every try reads as before ("no answer in time"). This also helps the other callers ofpagesinsrc/cloud/projects.ts.src/maintain/duties/cloud_watch.ts). The duty now has adueNow: it is due early when a watched account's last reading failed at leastRETRY_MS(5 min) ago. It also waits until 5 minutes after the duty's own last start, so an account whose credential won't open can't make it run every tick. The health sentence now says "It looks again within 6 minutes."docs/features/cloud.mddescribes the tries and the retry.What I chose not to do: hide a failed reading or wait for two in a row before reporting it. A provider that can't be read still raises the
/healthcard at once. It just stands for minutes now, not the hour.Reused: the runner's existing
dueNowhook (asdaily_proofuses it),lastStartedfromsrc/maintain/runs.ts, andlastReading. No new dependency.Tests:
test/cloud-watch-read.test.ts: a timed-out page is asked again and the list is read whole; a 503 is tried three times with 500 ms then 1000 ms pauses, then reported; a timeout on every try gives "no answer in time"; a 401, 403 or 404 is not retried.test/cloud-watch.test.ts: the duty is not due just under 5 minutes after a failure and is due at 5 minutes; a recent duty start holds it back; the new sentence; the try budget fits the duty's timeout; a clean reading stops the early runs.Checks run:
bun x tsc --noEmitis clean and the gate is green. The cloud-watch, cloud-projects, cloud-gate, maintain, vitals, notify, unused-exports and fetch-timeout suites pass.scripts/fast.tsnamed 510 files (about 36 minutes), so I picked the suites myself. A wider batch I started never finished: its tests were trying hosts the sandbox refuses (alpha--localhost,kid--localhost,homie--forge.test), so I have no result from it. The forge's full check covers it.How to see it in production: after this is live,
cloud-watch:digitalocean/prodshould leave the degraded list within about 6 minutes of a failed read, or never appear for a single slow page.🤖 Generated with Claude Code
Closes #17853