Closed maxpain closed 7 years ago
This is a problem in generic pool 2.4.2 which is used as a requirement. There is already a ticket to move to generic-pool 3: https://github.com/brianc/node-pg-pool/issues/29
I added a ticket to fix this bug in https://github.com/coopernurse/node-pool/pull/186 You can also route around it yourself, by specifying a ("min": 3) in your pool config object.
I also monkey patched it, if that is an approach that helps folks get through https://github.com/strongloop/loopback-connector-postgresql/pull/234
Its worth noting that some errors will require the pooled object to be recreated and some we could return the object to the pool. Not sure if it is worth it to try and distinguish between the two
Hey @bobbysmith007 that's a gross bug - I'm sorry about that! Would you be willing to put together a pull request w/ a failing test for this repo? Until pg@7.x
and pg-pool@2.x
I don't want to break backwards compat w/ node >= 0.10.x
so I'd be nice to have that work around here before the upgrade. If there's a PR with a failing test I'd likely be able to write a workaround here based on your work in the loopback connector.
Yes I can! Out till Monday but I will get it up soon.
If query throws error, then client not returning to connection pool. Example: