-
Notifications
You must be signed in to change notification settings - Fork 725
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
pkg: delete config when QPS and concurrency are both deleted #8653
Conversation
514d35a
to
d03c2f1
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8653 +/- ##
==========================================
- Coverage 77.54% 77.50% -0.04%
==========================================
Files 474 474
Lines 62359 62352 -7
==========================================
- Hits 48358 48328 -30
- Misses 10441 10446 +5
- Partials 3560 3578 +18
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/ratelimit/option.go
Outdated
return lim.(*limiter).updateDimensionConfig(cfg) | ||
status := lim.(*limiter).updateDimensionConfig(cfg) | ||
if status&QPSDeleted != 0 && status&ConcurrencyDeleted != 0 { | ||
l.limiters.Delete(label) |
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.
What will happen if this is not removed?
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.
leave a config in output that is meaningless
Signed-off-by: Ryan Leung <[email protected]>
/hold |
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
e4f7c17
to
cf11dfe
Compare
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
ef49704
to
d812f62
Compare
Signed-off-by: Ryan Leung <[email protected]>
2a5e80d
to
87b93a7
Compare
Signed-off-by: Ryan Leung <[email protected]>
2aa580b
to
c959207
Compare
@@ -89,6 +83,6 @@ func InitLimiter() Option { | |||
return InAllowList | |||
} | |||
l.limiters.LoadOrStore(label, newLimiter()) | |||
return ConcurrencyChanged | |||
return LimiterNotChanged |
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.
Has there been a change here, as expected?
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.
Yes, the limit is not changed when we initialize the limiter.
if limit <= eps || burst < 1 { | ||
l.rate = nil | ||
if l.isEmpty() { | ||
return LimiterDeleted |
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.
Should this be LimiterNoChanged
?
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.
No, LimiterDeleted indicates that we should remove the corresponding label from the config.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lhy1024, okJiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
What problem does this PR solve?
Issue Number: Ref #4373.
What is changed and how does it work?
Check List
Tests
Release note