jinyuxiaoqiang opened a new issue #5588:
URL: https://github.com/apache/apisix/issues/5588


   ### Issue description
   
   While using plugin 'limit-count',i encountered a problem:
   
situation:count:3000,time_window:1,rejected_code:503,policy:"redis",key:$remote_addr。
   reproduce: when requsting a route with above limit-count config a bit 
frequent about 500qps,apisix will return rejected_code.
   Adding log to limit-count.lua _M.access() and limit-count-redis.lua. I find 
an issue:
   local ret, err = red:ttl(key)  => ret = 0
   local b_key, err  = red:get(key)  =>b_key = null
   remaining, err = red:incrby(key, -1) => remaining = -1
   local a_key, err  = red:get(key)  => a_key = -1
   then leads to return nil, "rejected".
   so ret = 0  means key will expire soon,when executing the code after get 
ttl, the key is very likely deleted.
   please help to confirm the issue,thanks
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):2.2
   - OS (cmd: `uname -a`): Linux 820301ecfc7b 5.4.0-48-generic #52-Ubuntu SMP 
Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): nginx 
version: openresty/1.19.3.1
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 
etcdctl version: 3.4.13.    API version: 3.4
   - apisix-dashboard version, if have:2.3.0
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   3.5.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to