openresty / openresty/lua-resty-redis
failed to set keepalive: connection in dubious state
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 2k
- Forks
- 447
- Avg merge
- 2h 24m
- Merged PRs (30d)
- 3
Description
local redis = require "resty.redis"
local red = redis:new()
red:set_timeout(1000) -- 1 sec
local ok, err = red:connect("127.0.0.1", 6379)
if not ok then
ngx.say("failed to connect: ", err)
return
end
--ngx.say("connected to redis.")
local key = "testkey"
red:set(key, false)
local ok, err = red:set_keepalive(10000, 100)
if not ok then
ngx.say("failed to set keepalive: ", err)
return
end
The code bellow throw an error: "failed to set keepalive: connection in dubious state"
I know redis set support string value only, But "red:set(key, true)" will be ok, why?
Contributor guide
No contributing guide indexed for this repository
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 with the supplied Lua reproduction, especially red:set(key, false) and red:set_keepalive(10000, 100); compare it with the true case. Trace how these calls affect the Redis connection and determine whether the dubious-state error is expected or a bug. Done means explaining the difference and verifying the behavior or its fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, redis
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100