-
Notifications
You must be signed in to change notification settings - Fork 369
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
refactor: safeset for controller cache resource. #4528
Conversation
Signed-off-by: qicz <[email protected]>
Signed-off-by: qicz <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4528 +/- ##
==========================================
- Coverage 65.72% 65.70% -0.02%
==========================================
Files 211 212 +1
Lines 31669 31688 +19
==========================================
+ Hits 20813 20822 +9
- Misses 9656 9665 +9
- Partials 1200 1201 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: qicz <[email protected]>
Signed-off-by: qicz <[email protected]>
/retest |
@qicz can you elaborate the issue in the description |
Signed-off-by: qicz <[email protected]>
done |
Signed-off-by: qicz <[email protected]>
Signed-off-by: qicz <[email protected]>
Values sets.Set[T] | ||
} | ||
|
||
func NewSafeSet[T comparable](items ...T) *SafeSet[T] { |
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.
func NewSafeSet[T comparable](items ...T) *SafeSet[T] { | |
func New[T comparable](items ...T) *SafeSet[T] { |
|
||
type SafeSet[T comparable] struct { | ||
lock sync.RWMutex | ||
Values sets.Set[T] |
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 expose?
@qicz can you share more details about why we need a lock here? |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Following #4454, optimize the resources cached with the safety set.
Release Notes: Yes/No