-
Notifications
You must be signed in to change notification settings - Fork 260
fix: [NPM-WIN] do not refresh endpoints if pod cache is empty #1831
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
| // NOTE: ideally we won't refresh Pod Endpoints if the updatePodCache is empty | ||
| if dp.shouldUpdatePod() { | ||
| // do not refresh endpoints if the updatePodCache is empty | ||
| if len(dp.updatePodCache.cache) == 0 { |
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.
will need to lock the cache
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.
updated
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.
Locking the updatePodCache while refreshing Endpoints would be a regression in the sense that it would block Pod controller from doing any dataplane operations (e.g. AddToSets() and applyIPSets()).
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.
reconfigured locks
huntergregory
left a comment
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.
logic lgtm
* do not refresh endpoints if pod cache is empty * moved cache lock up * reposition cache lock * fixed incorrect logic
Reason for Change:
Not refreshing when not necessary improves NPM efficiency
Issue Fixed:
Requirements:
Notes: