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.
The pool discards the dead client and hands out a fresh one on the next attempt, so this is transient — same class as the existing P1017/P2028/57P01 blips.
Changes
lib/pg.ts: Add isPgClientNotQueryable helper that matches the raw pg/lib/client.js message.
sports/service.ts: Downgrade the error to info in fillRegister and tick catch blocks (same pattern as BIT-32810, BIT-32083).
lib/reporter.ts: Add the message to isTransientDatabaseError so any other code path that lets it propagate to a generic log.error is also suppressed (safety-net pattern from BIT-33537 for P2037).
Tests: Unit tests for the new helper and the reporter filter.
Paperclip-Issue: BIT-33527
## Summary
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.
The pool discards the dead client and hands out a fresh one on the next attempt, so this is transient — same class as the existing P1017/P2028/57P01 blips.
## Changes
- **`lib/pg.ts`**: Add `isPgClientNotQueryable` helper that matches the raw `pg/lib/client.js` message.
- **`sports/service.ts`**: Downgrade the error to `info` in `fillRegister` and `tick` catch blocks (same pattern as BIT-32810, BIT-32083).
- **`lib/reporter.ts`**: Add the message to `isTransientDatabaseError` so any other code path that lets it propagate to a generic `log.error` is also suppressed (safety-net pattern from BIT-33537 for P2037).
- **Tests**: Unit tests for the new helper and the reporter filter.
Paperclip-Issue: BIT-33527
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
A pooled
pgClient 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 messageClient has encountered a connection error and is not queryablehas no Prisma error code, so the existingisPrismaConnectionClosed(P1017) check does not catch it. The rejection escapes to the SportsWorkerfillRegisterandtickcatch blocks, logs aswarn, and pages the error loop.The pool discards the dead client and hands out a fresh one on the next attempt, so this is transient — same class as the existing P1017/P2028/57P01 blips.
Changes
lib/pg.ts: AddisPgClientNotQueryablehelper that matches the rawpg/lib/client.jsmessage.sports/service.ts: Downgrade the error toinfoinfillRegisterandtickcatch blocks (same pattern as BIT-32810, BIT-32083).lib/reporter.ts: Add the message toisTransientDatabaseErrorso any other code path that lets it propagate to a genericlog.erroris also suppressed (safety-net pattern from BIT-33537 for P2037).Paperclip-Issue: BIT-33527
auto-approve: CI success on
8d8573e53a(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
8d8573e53a(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
8d8573e53a(gitea_auto_approve_open_prs_once.py)