Summary
A pg pool client loses the pool's idle error listener while checked out. The ORM does not attach a replacement during transaction, session, stream, or tooling lifetimes, so a socket error while the client is idle in a transaction is emitted as an unhandled error event and terminates the Node process.
Triage
Confirmed, High. A real PostgreSQL backend terminated with pg_terminate_backend() causes the reproducer child process to exit from an unhandled 57P01 event instead of rejecting the transaction.
Required implementation details
- Wrap every checked-out
PoolClient immediately for its complete owned lifetime.
- Attach an
error listener that stores the first failure normalized through normalizeDatabaseError.
- Check the stored failure before and after queries and before a session can report success.
- Remove the listener on release and tell the pool to discard a failed client.
- Rollback/savepoint cleanup after connection failure must be best-effort and must not replace the original normalized failure.
- Apply the wrapper consistently to transaction, session, owned stream, and tooling-description checkouts.
Acceptance criteria
Definition of done
Severity
High — ordinary database failover, network loss, timeout termination, or administrative cancellation can otherwise terminate the host process.
Found via a real-PostgreSQL infrastructure-failure pass.
Summary
A
pgpool client loses the pool's idle error listener while checked out. The ORM does not attach a replacement during transaction, session, stream, or tooling lifetimes, so a socket error while the client is idle in a transaction is emitted as an unhandlederrorevent and terminates the Node process.Triage
Confirmed, High. A real PostgreSQL backend terminated with
pg_terminate_backend()causes the reproducer child process to exit from an unhandled57P01event instead of rejecting the transaction.Required implementation details
PoolClientimmediately for its complete owned lifetime.errorlistener that stores the first failure normalized throughnormalizeDatabaseError.Acceptance criteria
smiggleworth.errorlistener for the complete transaction/session/stream/tooling lifetime.DatabaseErrorusing the existing normalization and connection classification.57P01normalization, listener removal, and release.category: "connection"and code57P01.Definition of done
@askrjs/orm@0.0.2.Severity
High — ordinary database failover, network loss, timeout termination, or administrative cancellation can otherwise terminate the host process.
Found via a real-PostgreSQL infrastructure-failure pass.