fix(sports): downgrade transient Prisma transaction timeout from warn to info (BIT-32083) #292

Merged
spark merged 1 commits from fix/BIT-32083-transaction-timeout-guard into main 2026-11-20 22:59:37 +00:00
Owner

Context

BIT-32083 recurred: the same ERRSIG 27d2f7faaf73 (P2028 "Unable to start a transaction in the given time") reappeared 1 time in 13 days after PR #207 raised transactionOptions.maxWait to 10s in db.ts.

The 10s raise reduced frequency but did not eliminate the error — brief pool contention under concurrent worker load can still exceed 10s occasionally.

Fix

The SportsWorker.tick catch block already swallows errors and reschedules. This is the same class of transient blip as 57P01/P1017/P1001, already downgraded from warn to info in faces, autopilot, develop, and sports.

  • pg.ts: add isPrismaTransactionTimeout — matches P2028 or the message.
  • sports/service.ts: in SportsWorker.tick catch, log P2028 at info instead of warn.
  • pg.test.ts: 4 new tests.

Tested

  • vitest run src/lib/pg.test.ts — 22/22 passed.
  • tsc --noEmit — clean.

Paperclip-Issue: BIT-32083

## Context BIT-32083 recurred: the same ERRSIG `27d2f7faaf73` (P2028 "Unable to start a transaction in the given time") reappeared 1 time in 13 days after PR #207 raised `transactionOptions.maxWait` to 10s in `db.ts`. The 10s raise reduced frequency but did not eliminate the error — brief pool contention under concurrent worker load can still exceed 10s occasionally. ## Fix The `SportsWorker.tick` catch block already swallows errors and reschedules. This is the same class of transient blip as 57P01/P1017/P1001, already downgraded from `warn` to `info` in faces, autopilot, develop, and sports. - **`pg.ts`**: add `isPrismaTransactionTimeout` — matches P2028 or the message. - **`sports/service.ts`**: in `SportsWorker.tick` catch, log P2028 at `info` instead of `warn`. - **`pg.test.ts`**: 4 new tests. ## Tested - `vitest run src/lib/pg.test.ts` — 22/22 passed. - `tsc --noEmit` — clean. Paperclip-Issue: BIT-32083
spark added 1 commit 2026-11-20 22:49:34 +00:00
fix(sports): downgrade transient Prisma transaction timeout from warn to info (BIT-32083)
ci / rust (pull_request) Successful in 4m34s
ci / typescript (pull_request) Successful in 9m22s
0197b4f6e8
The transactionOptions maxWait raise to 10s in db.ts (PR #207) reduced
frequency but did not eliminate the P2028 "Unable to start a transaction
in the given time" error — 1 recurrence in 13 days under brief pool
contention. The sports tick already swallows errors and reschedules, so
this is transient like 57P01/P1017/P1001 already downgraded in faces,
autopilot, develop and sports itself.

Add isPrismaTransactionTimeout to pg.ts (matches P2028 code or message)
and use it in SportsWorker.tick to log at info instead of warn, so the
error loop no longer pages on a single pool-contention blip.

Paperclip-Issue: BIT-32083
spark merged commit 2ef155c891 into main 2026-11-20 22:59:37 +00:00
Sign in to join this conversation.