brianc / node-pg-pool

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

Max checkout timeout event #110

Open johanneswuerbach opened 5 years ago

johanneswuerbach commented 5 years ago

Based on https://github.com/brianc/node-pg-pool/pull/109

Adds a new force unlock timeout, which is by default disabled to stay backwards compatible.

This timeout forcefully ends the client if a client was taken from the pool longer then forceUnlockTimeoutMillis and the main use-case for this is preventing any kind of pool client leaks, which could render a pool consumers completely unusable.

WIP but happy about comments, will add tests as soon as possible.

brianc commented 5 years ago

Yeah I can't quite review this now until it's rebased on top of master after #109 lands. Initial thoughts:

This even will let folks who have scattered access directly to an instance of a pool throughout their application to diagnose things though which is good.

johanneswuerbach commented 5 years ago

@brianc thank for the review, I rebased this PR, removed the force-unlock logic and only left the event emitting.

Let me know what you think.

johanneswuerbach commented 5 years ago

@brianc happy new year 🎉 and friendly ping :-)

johanneswuerbach commented 5 years ago

@brianc if you have time, I would appreciate another look :-)

johanneswuerbach commented 5 years ago

@brianc anything else required to move this forward?