carlos8f / haredis

High-availability redis in Node.js.
https://npmjs.org/package/haredis
154 stars 21 forks source link

Node became a zombie after haredis lost connection with DNS #5

Closed shumkov closed 11 years ago

shumkov commented 11 years ago

My node service doesn't work properly after DNS service was down.

Into the service log i'm see a warnings from all my redis connections:

[23:44:09](haredis#4) warning: Error: getaddrinfo EADDRINFO

Service was running, but not responding propertly and looks like a zombie :).

The best approach is try to restart node process a few times.

How can i catch this error?

carlos8f commented 11 years ago

Weird that the underlying node_redis client didn't reconnect like it's supposed to, but you uncovered a bug anyway: there was no way to catch errors from individual nodes' node_redis clients. I fixed and published this in v0.2.9, once you are listening for client.on('error', function...) the error will get passed to you instead of writing to stderr. Thanks for using haredis!