Skip to content

Conversation

@ChuanFF
Copy link
Contributor

@ChuanFF ChuanFF commented Jan 5, 2026

Description

  1. support redis connection keepalive setting for limit-count,limit-conn,limit-req.
  2. fix some test case err(t/plugin/limit-count-redis4.t,Test2)
  3. in redis-cluster policy, the current redis_timeout only applies to send_timeout. This pr will make the values ​​of connect_timeout and send_timeout consistent with redis_timeout.

Which issue(s) this PR fixes:

relate issue: #12817

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jan 5, 2026
local delay, incoming_err = util.incoming(self, red, key, commit)
local ok, err = red:set_keepalive(conf.keepalive_timeout, conf.keepalive_pool)
if not ok then
core.log.error("set keepalive failed:", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
core.log.error("set keepalive failed:", err)
core.log.error("set keepalive failed: ", err)

local config = {
name = conf.redis_cluster_name,
serv_list = {},
keepalive_timeout = conf.keepalive_timeout, --redis connection pool idle timeout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
keepalive_timeout = conf.keepalive_timeout, --redis connection pool idle timeout
keepalive_timeout = conf.keepalive_timeout, -- redis connection pool idle timeout

name = conf.redis_cluster_name,
serv_list = {},
keepalive_timeout = conf.keepalive_timeout, --redis connection pool idle timeout
keepalive_cons = conf.keepalive_pool, --redis connection pool size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
keepalive_cons = conf.keepalive_pool, --redis connection pool size
keepalive_cons = conf.keepalive_pool, -- redis connection pool size

if err then
core.log.error("failed to create redis cli: ", err)
ngx.say("failed to create redis cli: ", err)
return nil,err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil,err
return nil, err

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the English document simultaneously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files. wait for update wait for the author's response in this issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants