fix(reporter): filter Prisma P2037 pool-exhaustion as transient (BIT-33537) #325

Merged
jos-alves merged 1 commits from fix/BIT-33537-p2037-connection-exhaustion-filter into main 2026-12-04 10:43:50 +00:00
Member

Problem

Prisma surfaces PostgreSQL's 53300 (too many clients) as P2037 with the message Too many database connections opened: sorry, too many clients already — no SQLSTATE in the text. The existing isTransientDatabaseError filter checked for 53300 in the message and P1001/P1017 by code, so P2037 slipped through and was reported to errors.bitreport.pt on every API request that hit pool exhaustion, tripping the Error Loop (ERRCLUSTER 2e002b9dda75).

Fix

  • Add P2037 to the code check in isTransientDatabaseError
  • Add too many clients already to the message regex as a fallback

Consistent with the 53300 filter added in BIT-33548.

Paperclip-Issue: BIT-33537

## Problem Prisma surfaces PostgreSQL's `53300` (too many clients) as **P2037** with the message `Too many database connections opened: sorry, too many clients already` — no SQLSTATE in the text. The existing `isTransientDatabaseError` filter checked for `53300` in the message and `P1001`/`P1017` by code, so P2037 slipped through and was reported to errors.bitreport.pt on every API request that hit pool exhaustion, tripping the Error Loop (ERRCLUSTER `2e002b9dda75`). ## Fix - Add `P2037` to the code check in `isTransientDatabaseError` - Add `too many clients already` to the message regex as a fallback Consistent with the `53300` filter added in BIT-33548. Paperclip-Issue: BIT-33537
jos-alves added 1 commit 2026-12-04 10:19:05 +00:00
fix(reporter): filter Prisma P2037 pool-exhaustion as transient (BIT-33537)
ci / typescript (push) Skipped
ci / rust (push) Skipped
ci / rust (pull_request) Successful in 6m49s
ci / typescript (pull_request) Successful in 13m29s
1c5bfce97f
Prisma surfaces PostgreSQL's 53300 (too many clients) as P2037 with the
message 'Too many database connections opened: sorry, too many clients
already' — no SQLSTATE in the text. The existing isTransientDatabaseError
filter checked for 53300 in the message and P1001/P1017 by code, so P2037
slipped through and was reported to errors.bitreport.pt on every API
request that hit pool exhaustion, tripping the Error Loop.

Add P2037 to the code check and 'too many clients already' to the regex
so the reporter stays quiet for this transient condition, consistent with
the 53300 filter added in BIT-33548.

Paperclip-Issue: BIT-33537
jos-alves merged commit ea29bd9b6e into main 2026-12-04 10:43:50 +00:00
Sign in to join this conversation.