brianc / node-pg-pool

A connection pool for node-postgres
MIT License
180 stars 64 forks source link

Do not return broken connections to the idle pool #82

Open boromisp opened 6 years ago

boromisp commented 6 years ago

Assuming that clients are unusable after emitting an error, the library should make sure, not to return broken connections to the idle pool.

Idle clients are dropped already on error, this change just extends that behavior to the active clients.

This is an un-breaking change (unless there are client errors one can recover from?), and could potentially remove the only real use-case I found for the second parameter of release.

The error flag on the client is needed because of the callback API.