Hitting maxclients causes "Cannot read property 'error' of undefined"
Open
Nobody has claimed this yet.
Bug
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
- Version: redis: 4.0.11 node_redis 2.8.0
- Platform: Ubuntu 18.04 GCP
- Description: If you start a redis client with no_ready_check, the maxclients error from the redis server causes the client to emit a loop of bad error messages which are particularly nasty to try debug in production.
$ docker run -it -p 9379:6379 redis redis-server -- --maxclients 1
$ redis-cli -p 6379 # leave this one hanging
$ node
> var r = require('redis'); var c = r.createClient({ port: 9379, no_ready_check: true });
undefined
> TypeError: Cannot read property 'error' of undefined
at RedisClient.return_error (.../node_modules/redis/index.js:687:21)
at JavascriptRedisParser.returnError (.../node_modules/redis/index.js:196:18)
at JavascriptRedisParser.execute (.../node_modules/redis-parser/lib/parser.js:572:12)
> TypeError: Cannot read property 'error' of undefined
at RedisClient.return_error (.../node_modules/redis/index.js:687:21)
at JavascriptRedisParser.returnError (.../node_modules/redis/index.js:196:18)
at JavascriptRedisParser.execute (.../node_modules/redis-parser/lib/parser.js:572:12)
> TypeError: Cannot read property 'error' of undefined
at RedisClient.return_error (.../node_modules/redis/index.js:687:21)
at JavascriptRedisParser.returnError (.../node_modules/redis/index.js:196:18)
at JavascriptRedisParser.execute (.../node_modules/redis-parser/lib/parser.js:572:12)
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 stack trace points to index.js:687 and redis-parser/lib/parser.js:572. Reproduce the case with the Docker Redis command and Node client shown in the issue, then inspect how the maxclients response is handled when no_ready_check is enabled. Done means the client reports a stable, useful error instead of repeatedly raising TypeErrors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, 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
- 48/100