connect-redis should listen the error event. #34

Closed
jerem opened this Issue Nov 21, 2011 · 6 comments

Comments

Projects
None yet
6 participants
Contributor

jerem commented Nov 21, 2011

Otherwise node_redis will not try to reconnect to the redis server.

ozten commented Dec 23, 2011

As it's configured, out of the box (unless I'm missing something) connect-redis will crash your node instance when you restart redis.

Can you update the basic example to include whatever code is needed to handle a redis crash? Have you considered giving retry logic to connect-redis with backoff, etc? Or making lazy connections to redis on an as needed basis? Most distributed systems assume a faulty network and crashy servers.

Thanks for a cool middleware!

inca commented Nov 19, 2013

+1 @ozten, app gets crashed after Redis disconnect + reconnect (connect-redis@1.4.6). Normally Redis client has a reconnect ability, not sure why connect-redis does not reconnect. See this gist discussion for possible solution.

Collaborator

chirag04 commented Nov 19, 2013

ok. I will look into this tomorrow.

Collaborator

wavded commented Aug 29, 2014

Closing this, node_redis will auto-reconnect when a disconnect occurs. If it doesn't, that's an issue with node_redis (connect-redis isn't doing anything special here). 2.1.0 is using latest redis.

@wavded wavded closed this Aug 29, 2014

inca commented Sep 1, 2014

Investigated this a while ago; FWIW node-redis reconnects quite well as long as you explicitly listen to its error event (this was pretty undocumented back then).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment