---
title: Detect wedged Postgres connections and processes on the league primary
type: task
status: planned
description: >-
  Build host-crontab detectors for aged Postgres backends and leaked long-lived node processes on
  the league primary, with resolve arms, and decide the batch-role split the per-role bounds depend
  on.
base_uri: user:task/league/detect-wedged-league-postgres-sessions.md
created_at: '2026-09-30T05:59:37.829Z'
entity_id: 78f9f30a-4560-47c4-835d-ff799cb63e31
owner_identity_uri: █████████████████████████
priority: Medium
public_read: true
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-09-30T05:59:37.829Z'
visibility_analyzed_at: '2026-11-05T23:49:09.060Z'
---

# Detect wedged Postgres connections and processes on the league primary

Three 2026-08 incidents went undetected: a 56-day leaked node process, a connection authenticated as a dropped role, and a write path failing 5,722 times in silence. Server-side `idle_in_transaction_session_timeout = 60s` has since landed in `10-league-tuning.conf`; the connection-age and process-age detectors do not exist.

## Plan

- [ ] Decide whether to split a batch role from `league_writer` here or hand it off, since per-role bounds depend on it — [[████████████████████████-██-███████████████-████████-█████-█████████████]]
- [ ] Build a connection-age detector and a non-pm2 long-lived node process detector as host crontab jobs, each with a paired resolve arm and a forced-bad-state proof

## Notes

The league primary moved during [[████████████████████████-██████-██████████]]; place the crontab on the current primary's bootstrap tree and re-derive the current timeout settings first.
