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

[DO NOT MERGE] AUTO load testing check #11498

Closed
wants to merge 1 commit into from

Conversation

amirylm
Copy link
Collaborator

@amirylm amirylm commented Dec 5, 2023

No description provided.

Copy link
Contributor

github-actions bot commented Dec 5, 2023

I see that you haven't updated any README files. Would it make sense to do so?

Copy link
Contributor

@EasterTheBunny EasterTheBunny left a 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
Copy link
Contributor

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.

Copy link
Contributor

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

@cl-sonarqube-production
Copy link

@amirylm amirylm force-pushed the auto-load-testing-check branch 2 times, most recently from 34681d5 to 4f86f01 Compare January 19, 2024 12:08
@amirylm amirylm force-pushed the auto-load-testing-check branch 2 times, most recently from cd62f6b to af3c516 Compare January 24, 2024 17:10
@amirylm amirylm force-pushed the auto-load-testing-check branch from af3c516 to 3f6adc7 Compare January 25, 2024 17:25
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@amirylm amirylm closed this Apr 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants