survivesLostConnections() function
Keep a pool's lost idle connection from ending the process.
Signature:
export declare function survivesLostConnections<P extends Pool>(pool: P): P;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
pool |
P |
The pool to guard. |
Returns:
P
The same pool.
Remarks
When the server closes a connection the pool is holding idle — a pg_terminate_backend, a failover, a maintenance restart — pg emits error on the pool itself. With no listener, that is an unhandled error event and Node exits. The pool has already discarded the client by then and the next checkout opens a fresh one, so the only thing left to do is say so.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.