Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: plugin limit-conn will keep rejecting the requests in some condition #11868

Open
wklken opened this issue Dec 27, 2024 · 0 comments
Open
Labels
bug Something isn't working plugin

Comments

@wklken
Copy link

wklken commented Dec 27, 2024

Current Behavior

https://github.com/apache/apisix/blob/master/apisix/plugins/limit-conn.lua#L84-L91

function _M.access(conf, ctx)
    return limit_conn.increase(conf, ctx)
end


function _M.log(conf, ctx)
    return limit_conn.decrease(conf, ctx)
end

if the request is interrupt in phase access like

function _M.access(conf, ctx)
    return 500
end

the log phase would not be executed, then the value of limiting is keep increasing and never decrease; and all the following requests would be rejected.

the data is in shared_dict, so can't reset it via apisix reload

Expected Behavior

decrease the value

Error Logs

No response

Steps to Reproduce

  1. enable limit-conn
  2. enable another plugin to return 500 in access

Environment

  • APISIX version (run apisix version): 3.2
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@dosubot dosubot bot added bug Something isn't working plugin labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant