-
Notifications
You must be signed in to change notification settings - Fork 734
runner: set capacity to Task channel #9226
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
Conversation
Signed-off-by: okJiang <[email protected]>
/retest |
Signed-off-by: okJiang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9226 +/- ##
==========================================
+ Coverage 76.05% 76.12% +0.06%
==========================================
Files 470 470
Lines 73028 73028
==========================================
+ Hits 55543 55589 +46
+ Misses 14039 14016 -23
+ Partials 3446 3423 -23
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
@@ -82,7 +82,7 @@ func TestConcurrentRunner(t *testing.T) { | |||
for i := 1; i < 11; i++ { | |||
regionID := uint64(i) | |||
if i == 10 { | |||
regionID = 4 | |||
regionID = 6 |
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.
why change it?
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.
To pass this ut. Capacity changed the pendingTask index. To ensure the task is not consumed as much as possible, I have increased the region ID a bit more.
I think the task will be handled well next time, even if you have the capacity, the same problem will still exist. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lhy1024, nolouch 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 |
/retest |
What problem does this PR solve?
Issue Number: Close #9222
What is changed and how does it work?
If the program processPendingTask and handle
<-ticker.C
in the same timepd/pkg/ratelimit/runner.go
Line 171 in f86063f
pd/pkg/ratelimit/runner.go
Line 133 in f86063f
, the task may be skipped due to taskChan block.
pd/pkg/ratelimit/runner.go
Lines 170 to 175 in f86063f
So, we can give a capacity to the task channel to avoid this situation.
Check List
Tests
Release note