-
Notifications
You must be signed in to change notification settings - Fork 601
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
Cache statefulset scale update/get requests #7651
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7651 +/- ##
==========================================
- Coverage 74.29% 74.01% -0.29%
==========================================
Files 262 262
Lines 15112 15172 +60
==========================================
+ Hits 11227 11229 +2
- Misses 3279 3337 +58
Partials 606 606 ☔ View full report in Codecov by Sentry. |
pkg/scheduler/scheduler.go
Outdated
func (sc *ScaleCache) Reset() { | ||
sc.entries = cache.NewExpiring() | ||
} |
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.
Can we make this thread-safe ?
Signed-off-by: Calum Murray <cmurray@redhat.com>
/cc @pierDipi |
pkg/scheduler/scheduler.go
Outdated
@@ -114,3 +123,83 @@ type VPod interface { | |||
|
|||
GetResourceVersion() string | |||
} | |||
|
|||
type ScaleCache struct { | |||
lock sync.RWMutex //protects access to entries, entries itself is concurrency safe, so we only need to ensure that we correctly access the pointer |
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.
Let's be specific on what this lock is associated with, usually <name> + Mu
lock sync.RWMutex //protects access to entries, entries itself is concurrency safe, so we only need to ensure that we correctly access the pointer | |
entriesMu sync.RWMutex // protects access to entries, entries itself is concurrency safe, so we only need to ensure that we correctly access the pointer |
/cc @pierDipi |
/retest |
Signed-off-by: Calum Murray <cmurray@redhat.com>
795285e
to
c76d64e
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, pierDipi 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 |
@pierDipi do we want to backport this to 1.13? |
Helps to fix the consumergroup issues we are seeing in ekb. At least some of the slow reconciliation is due to errors such as:
When we increased the client rate limit, these error logs were no longer present
Proposed Changes
Pre-review Checklist
Release Note