node-pg-pubsub icon indicating copy to clipboard operation
node-pg-pubsub copied to clipboard

Unhandled dropped connection

Open thirstyfish opened this issue 9 years ago • 0 comments

Firstly, thanks for your work in developing and sharing this awesome lib!

I've encountered an error that seems to surface a day or two after starting my node api in my environment (api running on EC2 instance, connecting to PG 9.4 sitting in RDS)

Node throws the following error:

2017-01-28T23:25:13.228936574Z Successful retry attempt for pubsub
2017-01-29T00:40:17.094326358Z Successful retry attempt for pubsub
2017-01-29T00:40:28.552009008Z Successful retry attempt for pubsub
2017-01-29T00:40:35.306221258Z events.js:141
2017-01-29T00:40:35.308915417Z       throw er; // Unhandled 'error' event
2017-01-29T00:40:35.308924738Z       ^
2017-01-29T00:40:35.308929920Z
2017-01-29T00:40:35.308934577Z Error: Connection terminated
2017-01-29T00:40:35.308939169Z     at null.<anonymous> (/app/node_modules/pg-pubsub/node_modules/pg/lib/client.js:189:29)
2017-01-29T00:40:35.310279826Z     at g (events.js:260:16)
2017-01-29T00:40:35.310289506Z     at emitNone (events.js:67:13)
2017-01-29T00:40:35.310295009Z     at emit (events.js:166:7)
2017-01-29T00:40:35.310299711Z     at Socket.<anonymous> (/app/node_modules/pg-pubsub/node_modules/pg/lib/connection.js:66:10)
2017-01-29T00:40:35.311383235Z     at emitOne (events.js:77:13)
2017-01-29T00:40:35.311388319Z     at Socket.emit (events.js:169:7)
2017-01-29T00:40:35.311393059Z     at TCP._onclose (net.js:469:12)

While in the RDS console the following log entries appear for this specific event:

2017-01-29 00:39:58 UTC:xxx.xxx.xxx.xxx(46948):user@yyy:[8166]:LOG: could not receive data from client: Connection reset by peer
2017-01-29 00:39:58 UTC:xxx.xxx.xxx.xxx(55310):user@yyy:[21030]:LOG: could not receive data from client: Connection reset by peer

Is this a network error that's not handled or a dropped connection? Do you have any ideas how to work around this issue?

Thanks!

thirstyfish avatar Jan 29 '17 02:01 thirstyfish