Public: anyone can read this; the crew can change it.
A paid forge's making watch sleeps by name and asks inside during, so main's timers test is green again #16377
Check · Review · Land · Live done — Landed and live in production.
fix/timers-during → main 0 commits
3 files
changed +5
−1
src/actions/order.ts +3 −1
| @@ -20,6 +20,7 @@ | ||
| 20 | 20 | * forge: a deploy that is refused leaves it `failed`, saying why. |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | import { during } from "../perf/jobs.ts"; | |
| 23 | 24 | import type { App } from "../app.ts"; |
| 24 | 25 | import { checkoutOf } from "../billing/checkout.ts"; |
| 25 | 26 | import { getOrder, holdName, markResent, markShown, move, takeTurn, unmarkShown, pendingFrom, MAX_PENDING_PER_ADDRESS, CHECKOUT_MS, nameHeld, newId, newTicket, dropPending, pendingCount, setSession, spawnedFor, ticketFits, MAX_PENDING, type Order } from "../billing/orders.ts"; |
| @@ -263,9 +264,10 @@ async function followMaking(app: App, id: string): Promise<void> { | ||
| 263 | 264 | try { |
| 264 | 265 | for (let i = 0; i < makingWatch.tries; i++) { |
| 265 | 266 | await new Promise((r) => setTimeout(r, makingWatch.everyMs).unref()); |
| 267 | // The ask is the work: it runs as a named job, the sleep before it only waits. | |
| 266 | 268 | const o = getOrder(app.db, id); |
| 267 | 269 | if (o?.state !== "making") return; |
| 268 | await askMaking(app, o, Date.now()); | |
| 270 | await during("order.making", () => askMaking(app, o, Date.now()), undefined, app); | |
| 269 | 271 | } |
| 270 | 272 | } catch (e) { |
| 271 | 273 | app.log.warn("a making order could not be asked after", { id, says: String(e).slice(0, 200) }); |
test/job-slices.test.ts +1
| @@ -273,6 +273,7 @@ const UNTIMED: Record<string, string> = { | ||
| 273 | 273 | desk: "expires notes past their time: one indexed delete on the desk table every 30 s (actions/desk.ts); the fixture has no notes", |
| 274 | 274 | ledger: "walks the cost ledger's hash chain at boot and once a day (#12273): file reads proportional to the ledger, off the request path; the fixture has no ledger", |
| 275 | 275 | "full-disk-probe": "one 64 KiB write every 2 s, only while the disk is full; the full-disk test drives probeFull directly", |
| 276 | "order.making": "one ask after a paid order's cloud machine every few seconds, at most 60, only while an order is making in this process: a row read and one call to the cloud (actions/order.ts, followMaking); the fixture has no order; order-cloud.test.ts turns the watch off (tries 0) and asks the order itself", | |
| 276 | 277 | "reach-asks": "a one-shot timer in actions/ask_host.ts, armed only while a hosted forge has an ask under an hour old: one signed call to its host over the network and a few rows; the fixture has no host", |
| 277 | 278 | "run-ending": "a one-shot timer in runs/ending.ts, armed only while a cancel waits on a worker here: at its deadline it announces the run once (a row read and one outbox write); run-cancel-stopping.test.ts drives whenEnded directly", |
| 278 | 279 | lane: "a closure in startChecks; starting the checks service starts cell checks — follow-up", |
test/timers-named.test.ts +1
| @@ -114,6 +114,7 @@ const ALLOWED: readonly Allowed[] = [ | ||
| 114 | 114 | ["src/core/v1_proof.ts", "done"], |
| 115 | 115 | ["src/maintenance/checks.ts", "done"], |
| 116 | 116 | ["src/chaos/faults.ts", "r"], |
| 117 | ["src/actions/order.ts", "r"], | |
| 117 | 118 | ["src/perf/sample.ts", "r"], |
| 118 | 119 | ["src/cluster/jobs.ts", "r"], |
| 119 | 120 | ["src/release/serving.ts", "r"], |
new above
offline