mirror of
https://github.com/block/buzz.git
synced 2026-11-09 02:41:57 +00:00
Schema migrations now run on a connection with both limits lifted. An index build on a populated table, or an ACCESS EXCLUSIVE wait behind live traffic, routinely outlasts the runtime caps, and startup treats a migration failure as fatal — so inheriting them turned a slow migration into a relay that cannot boot. sqlx also takes its migration advisory lock as one waiting statement, so a second replica rolling out would be canceled mid-wait instead of queueing. The connection is closed rather than returned to the pool, since its session still carries no limits. The two values move to DbConfig, wired to BUZZ_DB_STATEMENT_TIMEOUT and BUZZ_DB_LOCK_TIMEOUT with the previous constants as defaults, so a backfill or an incident does not need a code change. A malformed value falls back to the default with a warning: handing it to Postgres would fail every after_connect and take all database access with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Eli Foster <efoster@squareup.com>