Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions npm/pkg/dataplane/dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ func (dp *DataPlane) ApplyDataPlane() error {

// 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
dp.updatePodCache.Lock()
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

dp.updatePodCache.Unlock()
return nil
}
dp.updatePodCache.Unlock()

err := dp.refreshPodEndpoints()
if err != nil {
metrics.SendErrorLogAndMetric(util.DaemonDataplaneID, "[DataPlane] failed to refresh endpoints while updating pods. err: [%s]", err.Error())
Expand Down