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

RateLimiter#tryAcquire calculation problem. #15305

Closed
horizonzy opened this issue Apr 25, 2022 · 0 comments
Closed

RateLimiter#tryAcquire calculation problem. #15305

horizonzy opened this issue Apr 25, 2022 · 0 comments
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@horizonzy
Copy link
Member

Describe the bug

if (acquirePermit > this.permits) {
acquiredPermits = this.permits;
return false;
}

there are two problems.

  1. should acquirePermit + acquiredPermits > this.permits, not acquirePermit > this.permits.
  2. when it over permits, shouldn't increase acquirePermit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

2 participants