You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(database): remove the oven-sh/bun#42804 broken-pool detector, fixed in Bun 1.4.4 #2979
Bun 1.4.4 fixes oven-sh/bun#42804 (fixed by oven-sh/bun#45304, which ports oven-sh/bun#40913: onconnect never comes after onclose). Stacks' detector for pools broken by that bug is now dead code, and its own tripwire tests say to remove it.
Evidence
On Bun 1.4.4 (the version #2975 moves Stacks to), the two tripwire tests fail exactly as designed:
core/database/tests/broken-pool.test.ts
core/router/tests/health-broken-pool.test.ts
Both get Postgres's own error, terminating connection due to administrator command, instead of Bun's broken-slot connection must be a PostgresSQLConnection. On Bun 1.4.2 (control) they still reproduce the broken pool, 16/16 passing.
This Bun no longer leaves the pool broken the way oven-sh/bun#42804 describes. ... If this Bun carries the fix, remove the detector: core/database/src/broken-pool.ts, everything that feeds or reads it, and the tests and fixtures built on this server.
Scope
core/database/src/broken-pool.ts and its exports (index.ts, runtime.ts)
utils.ts: the persistent onQueryError hook on PostgreSQL/MySQL, recordPrimaryDatabaseQueryError, the replica builders' hooks
core/router/src/health.ts: the broken-pool 503
comments that cite the bug: ensure-database.ts, config/database.ts, docs/guide/query-monitoring.md, the stacks-database skill, the native catalog
tests and fixtures built on it: broken-pool.test.ts, health-broken-pool.test.ts, bun-42804-server.ts, broken-pool-detection.ts, and the hook counts pinned by query-logging.test.ts / query-hook-profile.ts
One effect worth stating: production on PostgreSQL/MySQL with query logging off goes back to installing no query hooks at all, the same as SQLite, so bun-query-builder's hook-free fast path applies there again.
Deleted core/database/src/broken-pool.ts, its exports, the PostgreSQL/MySQL onQueryError hook, the replica builders' hooks, the /api/health 503 and the tests and fixtures built on the reproduction server.
Production with query logging off installs no query hooks on any driver again. The per-driver hook profile test now pins that; as a control, expecting the old ["onQueryError"] profile fails with installed no hooks.
On 1.4.4: database 1360/0, router 434/0 and 441/0. Framework and defaults typecheck clean, with a planted reference to a removed export caught as TS2304.
Activity
glennmichael123 commentedon Oct 23, 2026
Removed in 94bf701, pushed alongside the Bun 1.4.4 pin (4ee1225, #2975).
core/database/src/broken-pool.ts, its exports, the PostgreSQL/MySQLonQueryErrorhook, the replica builders' hooks, the/api/health503 and the tests and fixtures built on the reproduction server.["onQueryError"]profile fails withinstalled no hooks.