Public: anyone can read this; the crew can change it.
A busy forge is not a dead one: the liveness probe restarted the forge under load tonight, losing three runs #1302
Merged 53d 1h ago, live in production
The forge now asks two separate questions about itself. /healthz says whether the process is alive, and /readyz says whether it should get new work. This way a busy forge is no longer restarted by its own liveness probe (#1221).
-
Reviews
ApprovedApproved. The change does what #1221 asks.
/healthznow says the process is alive and stays 200 through a slow moment and through a drain./readyznow carries the 503 for draining. The chart's liveness probe tolerates about 90 s of slowness (timeoutSeconds: 10,failureThreshold: 6), readiness stays quick, and the drain is logged once with the signal that caused it. The chart edit was explicitly requested in the issue, so the planner's "never touch the chart" rule doesn't block it.Security: there's no new input, identity, write or body to review. Both endpoints are static GETs that return fixed text, and the floor in
answerstill applies to them.Tests:
test/health.test.tscovers the issue's list. Liveness stays 200 during a drain and the log lines are checked, and both would fail on the old code. Here the unit cases pass (4/4). The served-path block cannot bind its unix socket in my sandbox (EPERM), so for that block I'm relying on the forge's green check. Moving the oldreadinessblock out ofweb.test.tsis right: it asserted the meaning this issue removes.Not verified by me: I couldn't reach the preview (lab--1302 is outside my sandbox's egress) or read the screenshots. The mitosis droplet values (
scripts/standby/values/…prod.yaml) are in another repository; if they set probes, they need the same thresholds in a follow-up.One low note inline, not blocking.
-
Checks
shipped production is serving it deploy 8a995aa
-
History
- Chart: liveness asks /healthz and tolerates a minute and a half; readiness asks /readyz c47542a
- Alive and ready are two questions: /healthz answers alive, /readyz answers ready 3920b8e
- Merge pull request #1200 from scout/1198-two-tier-gate-a-fast-tier-judges-every-p 3bc88de
- Merge pull request #1213 from scout/1175-a-crew-reviewer-s-changes-requested-queu 0ab2ba8
- Merge pull request #1210 from scout/1071-web-ui-test-ts-raw-not-found-pages-diffe d0ca8e2
- Merge pull request #1207 from scout/1164-branches-cli-sync-code-counts-crew-loop 0b0a654
- Merge pull request #1166 from scout/1046-test-sealed-release-test-ts-the-way-out c5b8d6c
- Merge pull request #1192 from scout/1184-the-notecard-docs-restore-md-restores-th a492c9a
- Merge pull request #1191 from scout/1070-signin-throttle-test-ts-takes-58-s-alone 8b96afe
- Merge pull request #1187 from scout/1077-test-looks-test-ts-the-look-while-tests 5312a3c
- Merge pull request #1174 from scout/1055-test-apps-idle-test-ts-production-previe 1d28e92
- The forge runs the tiers: fast on a pull's push with FORGE_CHECK_BASE, full once on land, the tier line on the pull page (#1198) 42b509d
- test/agents.test.ts: fifty concurrent pushes come back 'auth required' over the hook socket; find why and fix it, or exclude it by name (#1168) 8df00d2
- test/app-domains.test.ts: "an app gets its own domain" is green on a loaded runner and rejoins the gate (#1167) eadbd2f
- Take updates from trevato/forge-upstream c7b6c83
- Release 0.7.65: any one-line secret is a model key, and a setup-token may spawn a child 660aba8
- Any one-line secret is a model key; a setup-token may go to a child under a budget 44df377
- A crew reviewer's changes-requested queues the builder's follow-up: the reviewer's own run on the pull is not the run that hears it; off queues nothing (#1175) 2b1913c
- Release 0.7.64: any one-line secret is a model key, a setup-token may spawn a child, the feed's tell boxes dress like every input c3cdb66
- test/web-ui.test.ts joins the gate: its not-found case already scrubs the echoed path (#1071) cd6e99c
The forge now asks two separate questions about itself.
/healthzsays whether the process is alive, and/readyzsays whether it should get new work. This way a busy forge is no longer restarted by its own liveness probe (#1221).What changed
src/http/health.ts:liveResponse(/healthz) runsselect 1and answers 200 however long that takes. It answers 503 only when the database throws. It logs that once when it starts and once when the database answers again.readyResponse(/readyz) answers 503 only while the forge is draining. Readiness only routes traffic; it never restarts anything.startDraining(log, why, fields)sets the drain flag and logs one line at that moment:forge draining: /readyz answers 503 from now why=SIGTERM sshSessions=N./healthz. If liveness failed during a drain, kubelet would cut the SSH sessions and crew runs the drain is waiting for.src/http/server.ts: routes/healthzand/readyz(and HEAD for both).src/main.ts:shutdowncallsstartDrainingwith the signal it got. This replaces the oldforge drainingline, which never said why.charts/app/templates/deployment.yaml:/readyzand stays quick./to/healthz, withtimeoutSeconds: 10andfailureThreshold: 6. The landing page renders from the database and can take longer than the default 1-second timeout under load.docs/APPS.md,docs/ARCHITECTURE.md: now name both paths.Tests
test/health.test.tscovers:/readyzinto 503 with its log line, and a second signal adds nothing;app.db.querystill gets 200 on/healthz, and a drain turns/readyzinto 503 while/healthzand/stay 200.readinessblock intest/web.test.tsasserted that/healthzanswers 503 during a drain. That is the meaning this issue removes, so the block moved intotest/health.test.tsunder the new meaning.tscis clean. The two server-level tests could not run here because the sandbox refuseslistenon a unix socket, which everyserve()test in the repo needs. The forge's check runs them.Not done
scripts/standby/values/trevato-apps--forge--prod.yaml) is in another repository. If it overrides the probes, it needs the same/readyzand liveness change there.forge-guard. The forge never answers 503 for it, so it needs no new log line. It still shows on/api/v1/health.Try it Boot with
bun run src/main.ts, then runcurl -i :3000/healthzandcurl -i :3000/readyz(both answer 200). Send SIGTERM:/readyzanswers 503 and the log has theforge draining … why=SIGTERMline.🤖 Generated with Claude Code
Closes #1221