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
Prevent from no rate limiting when average is zero #9621
Conversation
We had already noted that we were relying on a buggy behaviour of x/time, and we had opened an issue for that: |
I wasn't aware of this issue was already submitted and I don't have any idea if this was fixed. My PR findings were discovered because of the docs vs code difference and the PR fix an issue with the following scenario. |
699ac18
to
bf1ecfb
Compare
bf1ecfb
to
f354947
Compare
4201925
to
de25cde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
What does this PR do?
Docs about
ratelimit
says that you can omit rate limiting by specifyingaverage
as0
. In traefik version< 2.7.2
it was true version2.7.2
introduce a bug and you cannot disable rate limiting in that way. The bug was probably related to bumping package golang.org/x/time. This change treats zero limits differently and nowrate.Inf
should be set whenaverage == 0
.Motivation
To restore the option with disabling rate limiting, which broke when the bug we relied on got fixed in x/time/rate:
https://go-review.googlesource.com/c/time/+/323429
More
Additional Notes