-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[DO NOT MERGE] AUTO load testing check #11498
Conversation
I see that you haven't updated any README files. Would it make sense to do so? |
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.
I'm still getting an idea of the logical change, but this review addresses the initial problem of integer overflow in the rate token logic.
if bucket < tokens { | ||
return false | ||
} | ||
t.buckets[key] = bucket - tokens |
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.
This could lead to an overflow where t.buckets[key]
would be the max value for uint32
.
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.
NVM. bucket < tokens
should handle this case.
bucket = 0 && tokens = 1 == true and returns false
bucket = 20 && tokens = 30 == true and returns false
bucket = 10 && tokens = 10 == false and continues safely
SonarQube Quality Gate |
34681d5
to
4f86f01
Compare
cd62f6b
to
af3c516
Compare
af3c516
to
3f6adc7
Compare
3f6adc7
to
f0423a5
Compare
SonarQube Quality Gate |
No description provided.