resourcegroup: replace blind sleep with signal-aware wait in acquireTokens (#10252)#10507
resourcegroup: replace blind sleep with signal-aware wait in acquireTokens (#10252)#10507JmPotato wants to merge 1 commit intotikv:release-8.5from
Conversation
…okens (cherry picked from commit 961bd132b28f6345af0df288a33741f9c7dcfd2e) Signed-off-by: JmPotato <github@ipotato.me>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThese changes implement a timer-aware retry mechanism with reconfiguration event signaling for the resource group token limiter. The limiter now exposes a reconfiguration notification channel, and the controller's token acquisition retry loop replaces blind sleep with a select statement that listens for timer expiry, reconfiguration signals, or context cancellation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/retest |
1 similar comment
|
/retest |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (59.37%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## release-8.5 #10507 +/- ##
===============================================
+ Coverage 77.93% 77.95% +0.02%
===============================================
Files 484 485 +1
Lines 65594 65743 +149
===============================================
+ Hits 51119 51251 +132
- Misses 10703 10720 +17
Partials 3772 3772
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: okJiang The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
| case rmpb.GroupMode_RUMode: | ||
| res := make([]*Reservation, 0, len(requestUnitLimitTypeList)) | ||
| for typ, counter := range gc.run.requestUnitTokens { | ||
| reconfiguredCh = counter.limiter.GetReconfiguredCh() |
There was a problem hiding this comment.
Should we move it to line 1365 if no only one type ?
There was a problem hiding this comment.
Although there is technically only one type at the moment, I kept it within a for loop to avoid code conflicts or confusing semantics.
| default: | ||
| } | ||
| } | ||
| case <-waitTimer.C: |
There was a problem hiding this comment.
Do we need to stop the timer here?
There was a problem hiding this comment.
For a time.Timer that has already triggered, there is no need to stop it.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
What problem does this PR solve?
Issue Number: close #10251.
What is changed and how does it work?
Cherry-pick of #10252 to release-8.5.
Check List
Tests
Release note
Summary by CodeRabbit