Repository navigation
Description
When concurrent writes wait on one thread row, they can occupy every gateway PostgreSQL connection and delay unrelated SQL reads until the row lock is released. This is reproducible on dev 3d44197868b9c42eec317dcc3bf5903841e6e582, without diagnostics code.
Related: #535, #542. This is a separate pool scheduling finding; no product fix is included in the diagnostics stack.
Reproduction
Use the disposable diagnostics fixture, a gateway pool of ten connections and worker ingest. Hold the fixture thread row with FOR UPDATE for 70 seconds, then issue nine concurrent metadata updates for that thread. Worker ingest takes the tenth connection. Request a SQL-backed thread list while the writes remain blocked.
External pg_stat_activity samples show all ten gateway connections waiting on tuple/transaction locks. On dev, the thread-list request used for the first view probe completes after 64,824.9 ms, followed by the second SQL-backed probe in 58.5 ms. Both complete successfully; this is waiting for connection availability, not a 60-second RPC timeout. The probes run serially, so the first one can absorb the stall.
On the Stage 3 checkout with the original nine-update fixture, diagnostic history reads complete after 59,819.1 ms with Stage 3 off and 59,828.4 ms with it on. The exact stalled view depends on timing, but the issue exists on dev as well.
Benchmark correction and follow-up
The acceptance fixture now uses eight blocked metadata updates, reserving capacity for worker ingest and one read. Each view probe logs its own successful completion and elapsed time. This preserves contention without forcing complete starvation; it does not fix production scheduling.
Investigate bounded admission or a reserved read connection so blocked writes cannot starve unrelated reads. Preserve owner scoping and transaction durability. Do not treat the old ~60-second measurements as diagnostic overhead or silently classify them as timeouts.
Sanitised evidence is in the diagnostics handoff: dev-pool9-timed-20261112 (dev control), isolation-pool9-20261112 (Stage 3 A/B), and isolation-pool8-20261112 (corrected fixture). Raw records remain private; no SQL text, parameters, credentials or user data are attached.
Activity
feat(diagnostics): show event loop, database and queue health (#535)
feat(diagnostics): show worker and synchronization health (#542)