-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Fix bugs in RateLimiterController #461
Fix bugs in RateLimiterController #461
Conversation
Codecov Report
@@ Coverage Diff @@
## master #461 +/- ##
============================================
+ Coverage 37.62% 37.62% +<.01%
- Complexity 982 983 +1
============================================
Files 235 235
Lines 7429 7433 +4
Branches 1017 1018 +1
============================================
+ Hits 2795 2797 +2
- Misses 4273 4274 +1
- Partials 361 362 +1
Continue to review full report at Codecov.
|
Hi, thanks for contributing. The zero-count problem is a bug (thanks for fixing that). As for |
ok,i'll keep the bugfix part and delete the commit which fix concurrent issue and reference annother issue to discuss it |
90e9f41
to
3e479f9
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.
LGTM
Thanks for contributing! |
[ISSUE alibaba#461]Purge filterserv related code in client
Describe what this PR does / why we need it
Fix bugs when count is zero
when count is zero,the costTime value will be max of long.After some retries of canPass,the waitTime will overflow and permit any request (as it will return true)
Does this pull request fix one issue?
Fixes #462
Describe how you did it
precheck and return when acquire count or count is less or equal than zero
Describe how to verify it
Test case in RateLimiterControllerTest.testPaceController_zeroattack
Special notes for reviews
The bug will lead to attack and make limiter useless