retry_strategy doesn't reset after flushing the error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
- Version: node_redis 2.6.5, redis 3.2.7
- Platform: Node.js 7.5.0 on Mac OS 10.12.3
- Description:
I'm using the following code
const redis = require('redis');
const client = redis.createClient({
url: 'redis://localhost:6379',
retry_strategy: options => new Error('Fail')
});
setInterval(() => client.incr('some-key', console.log), 5000);
running against a local redis (docker run --rm -p 6379:6379 redis)
After I see the first output, I kill the redis to simulate disconnect. When I've seen the error come in I restart the redis. The connection doesn't come up again. I would expect that after flushing the error to the offline handlers, the client would try to reconnect on the next command. instead it stays in closed state. Also it's returning with AbortError instead of new Error('Fail').
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
Run the supplied Node.js reproduction with redis.createClient, retry_strategy, client.incr, and a Redis restart. Trace the reconnect and offline-handler behavior after the first disconnect, checking why the client remains closed and returns AbortError instead of the configured Error('Fail'); done means the client reconnects on a later command with the expected error behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100