fix(sports): filter pg client not-queryable as transient (BIT-33527) #327

Merged
spark merged 1 commits from fix/BIT-33527-pg-client-not-queryable-transient into main 2026-12-04 11:32:57 +00:00
1 Commits
Author SHA1 Message Date
paula-alves 8d8573e53a fix(sports): filter pg client not-queryable as transient (BIT-33527)
ci / typescript (push) Skipped
ci / rust (push) Skipped
ci / rust (pull_request) Successful in 5m47s
ci / typescript (pull_request) Successful in 11m37s
A pooled pg Client that had a connection error (socket closed, server
restart, network blip) is marked not-queryable by node-postgres before
Prisma's adapter-pg runs the next query on it. The message
"Client has encountered a connection error and is not queryable" has no
Prisma error code, so the existing isPrismaConnectionClosed (P1017) check
does not catch it. The rejection escapes to the SportsWorker fillRegister
and tick catch blocks, logs as warn, and pages the error loop.

- Add isPgClientNotQueryable to lib/pg.ts and downgrade the error to info
  in fillRegister and tick (same pattern as BIT-32810, BIT-32083).
- Add the message to isTransientDatabaseError in reporter.ts so any other
  code path that lets it propagate to a generic log.error is also
  suppressed (same safety-net pattern as BIT-33537 for P2037).
- Add unit tests for the new helper and the reporter filter.

Paperclip-Issue: BIT-33527
2026-12-04 11:20:20 +00:00