Skip to content

[rate-limit] The cached count value differs according to the order of limiters. #830

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

Closed
y-tabata opened this issue Aug 1, 2018 · 2 comments

Comments

@y-tabata
Copy link
Contributor

y-tabata commented Aug 1, 2018

This depends on the lua-resty-limit-traffic.

https://github.com/openresty/lua-resty-limit-traffic/blob/ef080731b80fe00a385a4aed8a7f7f575d01c152/lib/resty/limit/traffic.lua#L26-L29

For example, we have 2 limiters (Limiter1 and Limiter2).
If the Limiter1 is rejected, it is not committed.
If the Limiter2 is rejected, it is committed.

We should call the uncommit in the above code.
Maybe the connections limiters are affected by this.

How to fix this is, first to submit a patch to the lua-resty-limit-traffic, and if no response, then to fork and to use the forked version, right?

@y-tabata
Copy link
Contributor Author

y-tabata commented Aug 14, 2018

Maybe the connections limiters are affected by this.

Since conn.lua decrements counts in the incoming function, only the fixed_window limiter is affected.

https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/limit/conn.lua#L59

@y-tabata
Copy link
Contributor Author

Closed by #843

@ghost ghost removed the B-current label Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant