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
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/12538-move-the-forge-to-bun-1-4-4-or-newer-1-3 → main 3 commits fork
8 files
changed +11
−11
Dockerfile +2 −2
| @@ -6,8 +6,8 @@ | ||
| 6 | 6 | # as a browser does. package.json's dependency list is empty, so there is |
| 7 | 7 | # nothing to install. |
| 8 | 8 | # 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 | |
| 11 | 11 | RUN apt-get update \ |
| 12 | 12 | && apt-get -y upgrade \ |
| 13 | 13 | && 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 @@ | ||
| 6 | 6 | "name": "forge", |
| 7 | 7 | "devDependencies": { |
| 8 | 8 | "@anthropic-ai/sandbox-runtime": "^0.0.79", |
| 9 | "@types/bun": "^1.2.0", | |
| 9 | "@types/bun": "^1.4.4", | |
| 10 | 10 | "@vscode/ripgrep": "1.18.0", |
| 11 | 11 | "axe-core": "^4.14.0", |
| 12 | 12 | "happy-dom": "^21.0.4", |
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | |
| 21 | 21 | "@pondwader/socks5-server": ["@pondwader/[email protected]", "", {}, "sha512-bQY06wzzR8D2+vVCUoBsr5QS2U6UgPUQRmErNwtsuI6vLcyRKkafjkr3KxbtGFf9aBBIV2mcvlsKD1UYaIV+sg=="], |
| 22 | 22 | |
| 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=="], | |
| 24 | 24 | |
| 25 | 25 | "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg=="], |
| 26 | 26 | |
| @@ -98,7 +98,7 @@ | ||
| 98 | 98 | |
| 99 | 99 | "buffer-image-size": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="], |
| 100 | 100 | |
| 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=="], | |
| 102 | 102 | |
| 103 | 103 | "commander": ["[email protected]", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="], |
| 104 | 104 |
package.json +1 −1
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | }, |
| 14 | 14 | "devDependencies": { |
| 15 | 15 | "@anthropic-ai/sandbox-runtime": "^0.0.79", |
| 16 | "@types/bun": "^1.2.0", | |
| 16 | "@types/bun": "^1.4.4", | |
| 17 | 17 | "@vscode/ripgrep": "1.18.0", |
| 18 | 18 | "axe-core": "^4.14.0", |
| 19 | 19 | "happy-dom": "^21.0.4", |
scripts/rehearse-roll.ts +1 −1
| @@ -112,7 +112,7 @@ async function goneError(forge: Forge): Promise<Error> { | ||
| 112 | 112 | pid: forge.proc.pid, |
| 113 | 113 | port: forge.port, |
| 114 | 114 | exitCode: forge.proc.exitCode, |
| 115 | signal: forge.proc.signalCode, | |
| 115 | signal: forge.proc.signalCode === null ? null : String(forge.proc.signalCode), | |
| 116 | 116 | waitedMs: Date.now() - forge.startedAt, |
| 117 | 117 | portsLost: forge.portsLost, |
| 118 | 118 | output: await said(forge), |
scripts/shards.ts +1 −1
| @@ -162,7 +162,7 @@ export function splitFiles( | ||
| 162 | 162 | * The most test files one `bun test` process runs. A process keeps what |
| 163 | 163 | * each file leaves behind (one global per process), and the forge was |
| 164 | 164 | * 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 | |
| 166 | 166 | * order: 40 files peaked at 548 MiB and 120 at 549 MiB — a process's peak |
| 167 | 167 | * is its heaviest file's plus what the files before it left, so 40 keeps |
| 168 | 168 | * 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( | ||
| 279 | 279 | |
| 280 | 280 | /** A stack frame in any of the languages a step's runtime might throw from. */ |
| 281 | 281 | 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)`. */ | |
| 283 | 283 | const VERSION_BANNER_RE = /^\S+ v[\d.]+ *\(/; |
| 284 | 284 | /** |
| 285 | 285 | * 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"; | ||
| 19 | 19 | export const REGION = "nyc3"; |
| 20 | 20 | export const SIZE = "s-1vcpu-2gb"; |
| 21 | 21 | /** 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"; | |
| 23 | 23 | |
| 24 | 24 | /** cloud-config for the droplet: Bun, the pinned source at the pinned version, a systemd unit. */ |
| 25 | 25 | 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 | ||
| 810 | 810 | }, |
| 811 | 811 | message(ws, message) { |
| 812 | 812 | if (isShellSocket(ws.data)) return shellWebSocket.message(asShell(ws), message); |
| 813 | return inner.message(asApp(ws), message); | |
| 813 | return inner.message?.(asApp(ws), message); | |
| 814 | 814 | }, |
| 815 | 815 | close(ws, code, reason) { |
| 816 | 816 | if (isShellSocket(ws.data)) return shellWebSocket.close(asShell(ws)); |
new above
offline