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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

fix/timers-during → main 0 commits

  • Merged. fix/timers-during was merged into main as 3b62a7f.

Review

Sign in to review this change.
3 files changed +5 −1
src/actions/order.ts +3 −1
@@ -20,6 +20,7 @@
2020 * forge: a deploy that is refused leaves it `failed`, saying why.
2121 */
2222
23 import { during } from "../perf/jobs.ts";
2324 import type { App } from "../app.ts";
2425 import { checkoutOf } from "../billing/checkout.ts";
2526 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> {
263264 try {
264265 for (let i = 0; i < makingWatch.tries; i++) {
265266 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.
266268 const o = getOrder(app.db, id);
267269 if (o?.state !== "making") return;
268 await askMaking(app, o, Date.now());
270 await during("order.making", () => askMaking(app, o, Date.now()), undefined, app);
269271 }
270272 } catch (e) {
271273 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> = {
273273 desk: "expires notes past their time: one indexed delete on the desk table every 30 s (actions/desk.ts); the fixture has no notes",
274274 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",
275275 "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",
276277 "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",
277278 "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",
278279 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[] = [
114114 ["src/core/v1_proof.ts", "done"],
115115 ["src/maintenance/checks.ts", "done"],
116116 ["src/chaos/faults.ts", "r"],
117 ["src/actions/order.ts", "r"],
117118 ["src/perf/sample.ts", "r"],
118119 ["src/cluster/jobs.ts", "r"],
119120 ["src/release/serving.ts", "r"],

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs