BruceFletcher / node-red-contrib-postgres-multi

Multi-query variant of node-red-contrib-postgres
Apache License 2.0
5 stars 11 forks source link

Connection terminated unexpectedly. #3

Open chainhead opened 6 years ago

chainhead commented 6 years ago

I am getting this error unpredictably in pm2 logs for Node-RED.

26 Jun 09:22:37 - [error] [postgres:DBQuery] Error: Connection terminated unexpectedly

I did some searches and found this:

What's happening now is one (or many) client(s) in your pool sits idle and connected to the backend database. A network partition happens or database failure, fail-over, forced disconnection from the backend, etc and the idle client(s) all notice and emit an error event. The pool listens for errors on idle clients. When an idle client has an error the pool destroys the client and removes it from the pool so the next time you request a client from the pool it will automatically create and connect a new client.

Should a pool.on('error', (err) { ... } be inserted after this?

justinSCS commented 3 years ago

I am also getting issues like this, which is then causing my whole node red/js server to crash and restart. Is there a fix for any of this?

image