node-postgres: Error: read ECONNRESET
Hi brianc, this is my first Bug report, so please don’t blame me for bad style:)
I have an issue with loosing connections. This happens after upgrading to node v0.10.1. I used v.8x? before and it worked. I am developing with Windows 8.
Maybe this happens because the Garbage Collector was modified in the new release? I wrote a simple mocha test that shows the problem. var pg = require(‘pg’);
describe('pg', function(){
this.timeout(65000);
describe('connection', function() {
it("should throw no error for 1 min", function(testDone) {
pg.on("error", function(e){
//"Error: read ECONNRESET" is thrown for me after 30sec
testDone(e)
});
pg.connect("tcp://postgres:1234@localhost/postgres", function(err, client, done){
client.query("select 'something'", function(err, result){
done();
if (err) return testDone (err);
setTimeout(function(){
testDone();
}, 60000);
});
})
});
});
})
Debugging this lead me to the assumption, that it is caused by the garbage collector, that is trying to destroy the tcp socket used by the database, but maybe I am completly wrong with this.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 18 (7 by maintainers)
Commits related to this issue
- ignore socket hangup. fixes #314 — committed to brianc/node-postgres by brianc 11 years ago
- Merge pull request #316 from brianc/ignore-socket-hangup ignore socket hangup. fixes #314 — committed to brianc/node-postgres by brianc 11 years ago
I still get this error when trying to connect in Windows 7 x64.
here’s the log: