iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure mode not working

railsmechanic opened this issue · comments

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

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.

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.