Skip to content

Conversation

@ck319
Copy link
Contributor

@ck319 ck319 commented Mar 2, 2023

Reason for Change:

Not refreshing when not necessary improves NPM efficiency

Issue Fixed:

Requirements:

Notes:

@ck319 ck319 requested a review from a team as a code owner March 2, 2023 01:07
@ck319 ck319 requested review from vakalapa and removed request for a team March 2, 2023 01:07
@ck319 ck319 added the npm Related to NPM. label Mar 2, 2023
// 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 {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

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()).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reconfigured locks

huntergregory
huntergregory previously approved these changes Mar 2, 2023
Copy link
Contributor

@huntergregory huntergregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic lgtm

vakalapa
vakalapa previously approved these changes Mar 2, 2023
@ck319 ck319 dismissed stale reviews from vakalapa and huntergregory via 5e6e5b1 March 3, 2023 22:55
@vakalapa vakalapa merged commit 2e211ef into master Mar 6, 2023
@vakalapa vakalapa deleted the ckovacs_refreshendpoints branch March 6, 2023 20:55
rjdenney pushed a commit that referenced this pull request Mar 13, 2023
* do not refresh endpoints if pod cache is empty

* moved cache lock up

* reposition cache lock

* fixed incorrect logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants