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 #14023

Merged opened this

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

Merged

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

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

Review

Sign in to review this change.
3 files changed +16 −2
src/engine/beat.ts +8 −1
@@ -1,6 +1,13 @@
1 import { BUSY_TIMEOUT_MS } from "../kernel/db.ts";
2
13 /** How often the engine says it is alive, and how long without it before the serving thread ends it (`host.ts`). */
24 export const BEAT_MS = 1_000;
3 export const STALL_MS = 15_000;
5 /**
6 * A statement waiting on another process's write lock (a roll, two forges on one data directory)
7 * blocks the thread for up to `BUSY_TIMEOUT_MS` and cannot beat meanwhile. The stall limit sits a
8 * margin beyond it, so that wait is never mistaken for a hang (it was: 15 s each, "why=silent").
9 */
10 export const STALL_MS = BUSY_TIMEOUT_MS + 15_000;
411 /**
512 * What the engine's thread says, before why, when it could not start its duties: the serving
613 * thread counts it a death at once.
src/kernel/db.ts +1 −1
@@ -21,7 +21,7 @@ const log = createLog("db");
2121 * in milliseconds. Failing a request that would have succeeded after a 3ms
2222 * wait is the worse outcome by a wide margin.
2323 */
24 const BUSY_TIMEOUT_MS = 15_000;
24 export const BUSY_TIMEOUT_MS = 15_000;
2525
2626 /**
2727 * Pages the index keeps hot. Negative means KiB rather than pages, so this
test/engine-stall.test.ts added +7
@@ -0,0 +1,7 @@
1 import { expect, test } from "bun:test";
2 import { STALL_MS } from "../src/engine/beat.ts";
3 import { BUSY_TIMEOUT_MS } from "../src/kernel/db.ts";
4
5 test("the engine is not called silent while a statement waits out the busy timeout", () => {
6 expect(STALL_MS).toBeGreaterThan(BUSY_TIMEOUT_MS);
7 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs