The RenderWorker tick handler only checked isPostgresAdminShutdown (57P01) and logged everything else at warn. When a $queryRaw in claimRenders hit PostgreSQL's max_connections limit — Prisma P2010 wrapping SQLSTATE 53300 ("sorry, too many clients already") — every tick paged the error loop.
Changes
lib/pg.ts: Extended isPrismaTooManyConnections to also match the P2010/53300 raw-query variant ("sorry, too many clients already", SQLSTATE 53300), in addition to the existing P2037 match.
develop/service.ts: Added a branch in the RenderWorker.tick catch block that checks isPrismaTooManyConnections and logs at info ("develop: poll skipped, too many database connections"), letting the next scheduled tick retry once a slot frees.
develop/service.test.ts: Added tests for the P2010/53300 variant in isPrismaTooManyConnections and for the tick handler logging it at info instead of warn.
Paperclip-Issue: BIT-33549
## Summary
The `RenderWorker` tick handler only checked `isPostgresAdminShutdown` (57P01) and logged everything else at `warn`. When a `$queryRaw` in `claimRenders` hit PostgreSQL's `max_connections` limit — Prisma P2010 wrapping SQLSTATE 53300 ("sorry, too many clients already") — every tick paged the error loop.
## Changes
- **`lib/pg.ts`**: Extended `isPrismaTooManyConnections` to also match the P2010/53300 raw-query variant ("sorry, too many clients already", SQLSTATE 53300), in addition to the existing P2037 match.
- **`develop/service.ts`**: Added a branch in the `RenderWorker.tick` catch block that checks `isPrismaTooManyConnections` and logs at `info` ("develop: poll skipped, too many database connections"), letting the next scheduled tick retry once a slot frees.
- **`develop/service.test.ts`**: Added tests for the P2010/53300 variant in `isPrismaTooManyConnections` and for the tick handler logging it at info instead of warn.
Paperclip-Issue: BIT-33549
The RenderWorker tick only checked isPostgresAdminShutdown (57P01) and
logged everything else at warn, so a $queryRaw hitting PostgreSQL's
max_connections limit (P2010 wrapping SQLSTATE 53300 'sorry, too many
clients already') paged the error loop on every tick.
Extend isPrismaTooManyConnections to also match the P2010/53300
raw-query variant, and add a branch in the tick handler that logs at
info and lets the next scheduled tick retry once a slot frees — same
pattern as the 57P01 admin-shutdown handling.
Paperclip-Issue: BIT-33549
spark
merged commit 243cabb221 into main2026-12-04 12:52:10 +00:00
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
The
RenderWorkertick handler only checkedisPostgresAdminShutdown(57P01) and logged everything else atwarn. When a$queryRawinclaimRendershit PostgreSQL'smax_connectionslimit — Prisma P2010 wrapping SQLSTATE 53300 ("sorry, too many clients already") — every tick paged the error loop.Changes
lib/pg.ts: ExtendedisPrismaTooManyConnectionsto also match the P2010/53300 raw-query variant ("sorry, too many clients already", SQLSTATE 53300), in addition to the existing P2037 match.develop/service.ts: Added a branch in theRenderWorker.tickcatch block that checksisPrismaTooManyConnectionsand logs atinfo("develop: poll skipped, too many database connections"), letting the next scheduled tick retry once a slot frees.develop/service.test.ts: Added tests for the P2010/53300 variant inisPrismaTooManyConnectionsand for the tick handler logging it at info instead of warn.Paperclip-Issue: BIT-33549