ECONNREFUSED crash since version 2.6.1
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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