fix(archive): downgrade 57P01 admin-terminated connection in rematch and takeOffFutureGames to info (BIT-32473) #277

Merged
spark merged 1 commits from fix/BIT-32473-archive-57p01-admin-shutdown into main 2026-11-18 22:31:18 +00:00
Owner

BIT-32473

Postgres killed a pooled client mid-query (a restart, pg_terminate_backend, SQLSTATE 57P01) and surfaced it as a PrismaClientKnownRequestError (P2039 wrapping Database error. Code: 57P01) inside findFixture -> eventOf -> rematch, and again in takeOffFutureGames. Both loops already stopped the batch on an unreachable database (P1001/57P03, BIT-32462/BIT-32469) but logged a warn per folder for 57P01, which paged the error loop for a transient blip.

Fix

Treat isPostgresAdminShutdown (57P01 / "terminating connection due to administrator command") the same way as an unreachable database in both loops: log at info, stop the batch, and let the next verifyAll retry once the pool reclaims a fresh client.

Tests

  • rematch: logs at info and stops the batch on 57P01 (BIT-32473)
  • takeOffFutureGames: logs at info and stops the batch on 57P01 (BIT-32473)
  • Existing P1001/P2010/57P03 and real-error cases still pass

Paperclip-Issue: BIT-32473
Paperclip-Cluster: 53d4888f9b94

## BIT-32473 Postgres killed a pooled client mid-query (a restart, `pg_terminate_backend`, SQLSTATE `57P01`) and surfaced it as a `PrismaClientKnownRequestError` (`P2039` wrapping `Database error. Code: 57P01`) inside `findFixture -> eventOf -> rematch`, and again in `takeOffFutureGames`. Both loops already stopped the batch on an unreachable database (P1001/57P03, BIT-32462/BIT-32469) but logged a `warn` per folder for `57P01`, which paged the error loop for a transient blip. ## Fix Treat `isPostgresAdminShutdown` (57P01 / "terminating connection due to administrator command") the same way as an unreachable database in both loops: log at `info`, stop the batch, and let the next `verifyAll` retry once the pool reclaims a fresh client. ## Tests - `rematch`: logs at info and stops the batch on 57P01 (BIT-32473) - `takeOffFutureGames`: logs at info and stops the batch on 57P01 (BIT-32473) - Existing P1001/P2010/57P03 and real-error cases still pass Paperclip-Issue: BIT-32473 Paperclip-Cluster: 53d4888f9b94
spark added 1 commit 2026-11-18 22:01:08 +00:00
fix(archive): downgrade 57P01 admin-terminated connection in rematch and takeOffFutureGames to info (BIT-32473)
ci / rust (pull_request) Successful in 4m22s
ci / typescript (pull_request) Successful in 10m41s
03fdba9557
Postgres killing a pooled client mid-query (a restart, pg_terminate_backend,
SQLSTATE 57P01) surfaced as a PrismaClientKnownRequestError (P2039 wrapping
'Database error. Code: 57P01') inside findFixture -> eventOf -> rematch, and
again in takeOffFutureGames. Both loops already stopped the batch on an
unreachable database (P1001/57P03, BIT-32462/BIT-32469) but logged a warn per
folder for 57P01, which paged the error loop for a transient blip.

Treat isPostgresAdminShutdown the same way: log at info, stop the batch, and
let the next verifyAll retry once the pool reclaims a fresh client.

Paperclip-Issue: BIT-32473
Paperclip-Cluster: 53d4888f9b94
paperclip-review-bot left a comment
Member

auto-approve: CI success on 03fdba9557 (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success on 03fdba955754 (gitea_auto_approve_open_prs_once.py)
founding-engineer left a comment
Member

auto-approve: CI success on 03fdba9557 (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success on 03fdba955754 (gitea_auto_approve_open_prs_once.py)
devops-engineer left a comment
Member

auto-approve: CI success on 03fdba9557 (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success on 03fdba955754 (gitea_auto_approve_open_prs_once.py)
spark merged commit 812adb21a6 into main 2026-11-18 22:31:18 +00:00
Sign in to join this conversation.