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

Sentinel: The log says "engine: the engine stopped; serving goes on, it starts again why=silent inMs=N restarts=N" 3 times #14195

Merged opened this

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

Merged

scout/forge:scout/14193-sentinel-the-log-says-engine-the-engine → main 1 commit fork

  • Merged. scout/14193-sentinel-the-log-says-engine-the-engine was merged into main as c9d1697.

Review

Sign in to review this change.
2 files changed +6 −2
src/engine/beat.ts +3 −1
@@ -6,8 +6,10 @@ export const BEAT_MS = 1_000;
66 * A statement waiting on another process's write lock (a roll, two forges on one data directory)
77 * blocks the thread for up to `BUSY_TIMEOUT_MS` and cannot beat meanwhile. The stall limit sits a
88 * margin beyond it, so that wait is never mistaken for a hang (it was: 15 s each, "why=silent").
9 * One tick of the duties can wait out two such locks one after the other (a roll again, 2026-11-16,
10 * `why=silent` three more times after the first margin), so the limit holds three.
911 */
10 export const STALL_MS = BUSY_TIMEOUT_MS + 15_000;
12 export const STALL_MS = 3 * BUSY_TIMEOUT_MS;
1113 /**
1214 * What the engine's thread says, before why, when it could not start its duties: the serving
1315 * thread counts it a death at once.
test/engine-stall.test.ts +3 −1
@@ -1,7 +1,9 @@
11 import { expect, test } from "bun:test";
2 import { STALL_MS } from "../src/engine/beat.ts";
2 import { BEAT_MS, STALL_MS } from "../src/engine/beat.ts";
33 import { BUSY_TIMEOUT_MS } from "../src/kernel/db.ts";
44
55 test("the engine is not called silent while a statement waits out the busy timeout", () => {
66 expect(STALL_MS).toBeGreaterThan(BUSY_TIMEOUT_MS);
7 // A tick of the duties can wait out two locks in a row and still be alive.
8 expect(STALL_MS).toBeGreaterThanOrEqual(2 * BUSY_TIMEOUT_MS + BEAT_MS);
79 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs