retry_strategy never called after disconnect?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
There seems to be an issue with retry_strategy when the client loses the redis connection.
Example:
const redis = redis_lib.createClient({
"url": "redis://" + config.IP,
retry_strategy: function (options) {
console.log("Called");
return 200;
}
});
- If the IP is bad, and can never connects to redis, the function is called, and reconnects attempts happen every 200ms as expected.
- If the IP is good, it connects to redis, but after the connection drops, this function is not called, instead some default logic takes place, where the reconnect intervals grows exponentially.
(ex: 3, 6, 12, etc)
Environment
node --version
v10.21.0
redis-server --version
Redis server v=6.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=35e65e7214deffbe
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
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
Start by reproducing the two cases described: an unreachable Redis server and a connection that drops after succeeding. Trace how retry_strategy is handled during initial connection versus post-disconnect reconnects, then verify that the configured 200ms behavior is used after a drop and that tests cover both paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100