Skip to content

bug: 500 error when bench limit-count plugin #1901

@UnderTreeTech

Description

@UnderTreeTech

limit count conf:
policy: redis
count: 100
time_window: 60
key: remote_addr
os: CentOS 7.6
benchmark tool: apache benchmark

I got runtime error which result in 500 response when i bench 1million request, 1k concurrency by ab.It seems red:ttl(key) return nil in limit-count-redis.lua. The follow snippet is runtime error detail:

lua entry thread aborted: runtime error: .../apisix/apisix/plugins/limit-count/limit-count-redis.lua:76: attempt to compare nil with number
stack traceback:
coroutine 0:
        .../apisix/apisix/plugins/limit-count/limit-count-redis.lua: in function 'incoming'
        /usr/local/apisix/apisix/plugins/limit-count.lua:121: in function 'phase_fun'
        /usr/local/apisix/apisix/init.lua:147: in function 'run_plugin'
        /usr/local/apisix/apisix/init.lua:385: in function 'http_access_phase'
        access_by_lua(nginx.conf:161):2: in main chunk

Is it a bug? @membphis @moonming

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions