openresty / openresty/lua-resty-redis

failed to set keepalive: connection in dubious state

Open
#78 7 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.