Skip to content

bug: limit-count may prevent more requests by mistake that should access normally in High concurrency scenarios #3988

Description

@ychdesign

Issue description

{
"count": 4000,
"key": "server_addr",
"policy": "redis-cluster",
"redis_cluster_nodes": [],
"rejected_code": 500,
"time_window": 1
}

When the threshold not reached,a few requests are prevented by the limit-count plugin.
The founction incoming, ttl and incrby opreations are not atomic.
Maybe can use eval() to ensure it.

Environment

  • apisix version : 2.0
  • OS (cmd: uname -a): Linux 2020 x86_64 x86_64 x86_64 GNU/Linux
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V): openresty/1.19.3.1

Minimal test code / Steps to reproduce the issue

压测即可复现

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions