redis / redis/node-redis

ECONNREFUSED crash since version 2.6.1

Open
#1,080 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

  • Version: 2.6.1
  • Platform: Node.js v4.2.6 on OS X 10.11.5
  • Description: Description of your issue, stack traces from errors and code that reproduces the issue

The default retry strategy:

var client = redis.createClient({
    retry_strategy: function (options) {
        if (options.error.code === 'ECONNREFUSED') {
            // End reconnecting on a specific error and flush all commands with a individual error
            return new Error('The server refused the connection');
        }
...
        // reconnect after
        return Math.max(options.attempt * 100, 3000);
    }
});

Crashes since version 2.6.1

if (options.error.code === 'ECONNREFUSED')
                 ^
TypeError: Cannot read property 'code' of null

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no source file or test; begin with the retry_strategy callback in the Redis client configuration and trace how ECONNREFUSED reaches options.error. Reproduce the reported failure and confirm that the callback handles the null error without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, redis
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.