Skip to content

Commit

Permalink
Merge pull request #6602 from ctripcloud/fix-memory-leak
Browse files Browse the repository at this point in the history
fix memory leak in NodeDeleteTracker
  • Loading branch information
k8s-ci-robot authored Mar 15, 2024
2 parents 1b4d478 + 51b8133 commit 75e7df6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func (n *NodeDeletionTracker) ClearResultsNotNewerThan(t time.Time) {
func (n *NodeDeletionTracker) Snapshot() *NodeDeletionTracker {
n.Lock()
defer n.Unlock()

n.evictions.DropNotNewerThan(n.clock.Now().Add(-n.evictionsTTL))

snapshot := NewNodeDeletionTracker(n.evictionsTTL)
for k, val := range n.emptyNodeDeletions {
snapshot.emptyNodeDeletions[k] = val
Expand Down

0 comments on commit 75e7df6

Please sign in to comment.