node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

pool.end() promise never resolves

Open gajus opened this issue 3 years ago • 2 comments

const connection1 = await pool.connect();
const connection2 = await pool.connect();

await connection1.end();
await connection2.end();

await pool.end();

is giving Error: Promise returned by test never resolved

gajus avatar Aug 03 '22 17:08 gajus

More context https://github.com/gajus/postgres-bridge/commit/38b69ded692775e8fefa3c53f3a30a143bc1cdc4

gajus avatar Aug 03 '22 17:08 gajus

There’s probably something to fix here, but note that you shouldn’t call .end() on connections acquired from a pool – just .release() or .release(true).

charmander avatar Aug 05 '22 01:08 charmander