fix(sports): downgrade 57P01 admin-terminated connection in linkStoredSquads to info (BIT-32471) #275

Merged
spark merged 1 commits from fix/BIT-32471-sports-57p01-admin-shutdown into main 2026-11-18 21:40:03 +00:00
1 Commits
Author SHA1 Message Date
paula-alves b7aa187154 fix(sports): downgrade 57P01 admin-terminated connection in linkStoredSquads to info (BIT-32471)
ci / rust (pull_request) Successful in 4m28s
ci / typescript (pull_request) Successful in 10m0s
Postgres terminates a pooled client mid-query on restart or
`pg_terminate_backend` (SQLSTATE 57P01); Prisma surfaces the raw-query
failure as P2010 wrapping "terminating connection due to administrator
command". linkStoredSquads runs an unguarded `$queryRaw`, so the rejection
escaped to SportsWorker.fillRegister's catch and logged `warn` ("sports:
register not filled"), paging the error loop for a transient blip.

Wrap the `$queryRaw` (extracted into linkStoredSquadsRows) so an
admin-shutdown is detected via isPostgresAdminShutdown, logged at info, and
returns 0 — fillRegister's loop breaks and the next scheduled tick retries
on a fresh client. Non-transient errors still rethrow. The same helper
already covers the equivalent raw-query path (BIT-32448/32449).

Paperclip-Issue: BIT-32471
2026-11-18 21:27:11 +00:00