iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower
Apache License 2.0
393 stars 82 forks source link

Failure mode not working #32

Closed railsmechanic closed 6 years ago

railsmechanic commented 11 years ago

I've tested follow and its failure handling with the vanilla example.

var follow = require('follow');

follow({db:"http://127.0.0.1:5984/demo", inactivity_ms: (60 * 60 * 60 * 1000)}, function(error, change) {
  if(!error) {
    console.log("Got change number " + change.seq + ": " + change.id);
  }
});

Everything works fine until CouchDB is running, but when I shut down CouchDB follow raises:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: connect ETIMEDOUT
    at errnoException (net.js:884:11)
    at Object.afterConnect [as oncomplete] (net.js:875:19)

It would be inevitable for my application that follow still waits until the server is available again.

CouchDB v1.3.0 node v0.10.8 follow v0.9.0

jhs commented 11 years ago

Yes, thanks for this. I think possibly Follow is not catching an error, perhaps in the new 0.10 Node. I will try to make a unit test to duplicate this.

glacialman commented 10 years ago

You can try make some test cases for the connections between your node and the others e.g. CouchDB. I had the same by connecting between node and Postgres/MongoDB.