Skip to content

Make retry vars still hold in an authrization failer#528

Merged
brycebaril merged 2 commits into
redis:masterfrom
whockey:master
Dec 15, 2013
Merged

Make retry vars still hold in an authrization failer#528
brycebaril merged 2 commits into
redis:masterfrom
whockey:master

Conversation

@whockey

@whockey whockey commented Dec 12, 2013

Copy link
Copy Markdown
Contributor

Only resetting the the retry_vars if the connection is actually established. Otherwise the reconnection could infinitely attempt to reconnect on an auth failure regardless of max_attempts, retry_delay etc.

Example:

  1. Send in max_attempts:5
  2. Redis accepts the socket connection, but rejects at the auth level (invalid auth, max clients etc)
  3. node_redis thought the connection was successful and reset the rety_vars
  4. However, do_auth emits an error event on a failure auth, which starts a reconnection

This change only resets the retry variables if the connection was actually successful.

@brycebaril brycebaril merged commit 313fd7f into redis:master Dec 15, 2013
@brycebaril

Copy link
Copy Markdown
Contributor

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants