-
Notifications
You must be signed in to change notification settings - Fork 78
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
standardize binder cache store #52
Conversation
19266f2
to
fb148e5
Compare
@@ -260,6 +268,8 @@ func (binder *Binder) CheckAndBindUnit(ctx context.Context) bool { | |||
klog.InfoS("Failed to check stage for unit", "stageIndex", i, "stageName", stage.stageName, "unitKey", unit.GetKey(), "err", err) | |||
} | |||
|
|||
klog.V(4).InfoS("Finish to check stage for unit", "stageIndex", i, "stageName", stage.stageName, "unitKey", unit.GetKey()) |
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.
good catch
lgtm overall, just nits |
fb148e5
to
bcf1995
Compare
@lzlaa Could you also help take a look at this PR when getting a chance? Thank you. |
|
||
// TODO: Extend the metrics related. | ||
// updateMetrics updates cache size metric values for pods, assumed pods, and nodes | ||
func (cache *binderCache) updateMetrics() { | ||
cache.mu.Lock() |
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.
Just RLock、RUnlock is ok,since there no update operation for PodStore or NodeStore
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.
There's only read operation for PodStore or NodeStore; however, there's update on binder cache size. If we use read lock, multiple threads can call updateMetrics() and modify the only binder cache size. Thoughts?
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.
I also prefer to keep the use of write lock.
bcf1995
to
1ce06bb
Compare
Fist half of the second step of #45
Standardize binder cache implementation based on the common store interface.