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

Move the forge to Bun 1.4.4 or newer: 1.3.14 shares one unlocked SQLite handle table across threads and it crashed production four times #12545

Merged opened this in answer to

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

Merged

mason/forge:mason/12538-move-the-forge-to-bun-1-4-4-or-newer-1-3 → main 3 commits fork

  • Merged. mason/12538-move-the-forge-to-bun-1-4-4-or-newer-1-3 was merged into main as 3c11651.

Review

Sign in to review this change.
8 files changed +11 −11
Dockerfile +2 −2
@@ -6,8 +6,8 @@
66 # as a browser does. package.json's dependency list is empty, so there is
77 # nothing to install.
88 # The Bun version is chosen, not floated: a rebuild must not change the
9 # runtime unasked. Whether to move off 1.3.14 waits on the decode issue (#3726).
10 FROM oven/bun:1.3.14-debian
9 # runtime unasked. 1.4.4 is the first with a per-thread bun:sqlite handle table (#12538).
10 FROM oven/bun:1.4.4-debian
1111 RUN apt-get update \
1212 && apt-get -y upgrade \
1313 && apt-get install -y --no-install-recommends git ca-certificates curl bubblewrap socat nodejs npm tini chromium fonts-liberation \
bun.lock +3 −3
@@ -6,7 +6,7 @@
66 "name": "forge",
77 "devDependencies": {
88 "@anthropic-ai/sandbox-runtime": "^0.0.79",
9 "@types/bun": "^1.2.0",
9 "@types/bun": "^1.4.4",
1010 "@vscode/ripgrep": "1.18.0",
1111 "axe-core": "^4.14.0",
1212 "happy-dom": "^21.0.4",
@@ -20,7 +20,7 @@
2020
2121 "@pondwader/socks5-server": ["@pondwader/[email protected]", "", {}, "sha512-bQY06wzzR8D2+vVCUoBsr5QS2U6UgPUQRmErNwtsuI6vLcyRKkafjkr3KxbtGFf9aBBIV2mcvlsKD1UYaIV+sg=="],
2222
23 "@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
23 "@types/bun": ["@types/bun@1.4.4", "", { "dependencies": { "bun-types": "1.4.4" } }, "sha512-9wkRDXUXK124pEnAutE6n/l18j+i9GC5IAHK8TmX/2nlySETmky0OU6yL5U8pW1AoKh++AN9auDCr647BfurjQ=="],
2424
2525 "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg=="],
2626
@@ -98,7 +98,7 @@
9898
9999 "buffer-image-size": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="],
100100
101 "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
101 "bun-types": ["bun-types@1.4.4", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-yjrJh5oGX7mMPKGd19YXyIjmEuj4G4zNC30bs7PM9Az7NQ3ndF3j6hbeRdvJTRQEhJ/FYQwW0a2moweEi2hMxQ=="],
102102
103103 "commander": ["[email protected]", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
104104
package.json +1 −1
@@ -13,7 +13,7 @@
1313 },
1414 "devDependencies": {
1515 "@anthropic-ai/sandbox-runtime": "^0.0.79",
16 "@types/bun": "^1.2.0",
16 "@types/bun": "^1.4.4",
1717 "@vscode/ripgrep": "1.18.0",
1818 "axe-core": "^4.14.0",
1919 "happy-dom": "^21.0.4",
scripts/rehearse-roll.ts +1 −1
@@ -112,7 +112,7 @@ async function goneError(forge: Forge): Promise<Error> {
112112 pid: forge.proc.pid,
113113 port: forge.port,
114114 exitCode: forge.proc.exitCode,
115 signal: forge.proc.signalCode,
115 signal: forge.proc.signalCode === null ? null : String(forge.proc.signalCode),
116116 waitedMs: Date.now() - forge.startedAt,
117117 portsLost: forge.portsLost,
118118 output: await said(forge),
scripts/shards.ts +1 −1
@@ -162,7 +162,7 @@ export function splitFiles(
162162 * The most test files one `bun test` process runs. A process keeps what
163163 * each file leaves behind (one global per process), and the forge was
164164 * OOM-killed with 29 of them at 230–380 MiB each, ~110 files apiece
165 * (#2410). Measured with VmHWM on Bun 1.3.14, light gate files in name
165 * (#2410). Measured with VmHWM on Bun 1.3.14 (not re-measured on 1.4.4), light gate files in name
166166 * order: 40 files peaked at 548 MiB and 120 at 549 MiB — a process's peak
167167 * is its heaviest file's plus what the files before it left, so 40 keeps
168168 * that under 1 GiB with room, and costs a spawn (~0.1 s) per 40 files.
src/apps/process.ts +1 −1
@@ -279,7 +279,7 @@ function operatorVars(
279279
280280 /** A stack frame in any of the languages a step's runtime might throw from. */
281281 const STACK_FRAME_RE = /^at\s/;
282 /** A runtime's version banner, printed after an uncaught error — `Bun v1.3.14 (Linux x64 baseline)`. */
282 /** A runtime's version banner after an uncaught error: `Bun v1.4.4 (Linux x64 baseline)`. */
283283 const VERSION_BANNER_RE = /^\S+ v[\d.]+ *\(/;
284284 /**
285285 * A line that reads as an error rather than context around one — anchored
src/cloud/droplet.ts +1 −1
@@ -19,7 +19,7 @@ const API = "https://api.digitalocean.com/v2";
1919 export const REGION = "nyc3";
2020 export const SIZE = "s-1vcpu-2gb";
2121 /** The Bun the droplet installs: it moves only when this line does, in a pull, so the runtime is pinned as the forge is. */
22 export const BUN_VERSION = "1.3.14";
22 export const BUN_VERSION = "1.4.4";
2323
2424 /** cloud-config for the droplet: Bun, the pinned source at the pinned version, a systemd unit. */
2525 export function bootConfig(p: Pick<Pinned, "name" | "source" | "version" | "config">): string {
src/machines/shell.ts +1 −1
@@ -810,7 +810,7 @@ export function withShells<A extends object>(inner: Bun.WebSocketHandler<A>): Bu
810810 },
811811 message(ws, message) {
812812 if (isShellSocket(ws.data)) return shellWebSocket.message(asShell(ws), message);
813 return inner.message(asApp(ws), message);
813 return inner.message?.(asApp(ws), message);
814814 },
815815 close(ws, code, reason) {
816816 if (isShellSocket(ws.data)) return shellWebSocket.close(asShell(ws));

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs