Skip to content

Commit

Permalink
Merge pull request kubernetes#101796 from wzshiming/automated-cherry-…
Browse files Browse the repository at this point in the history
…pick-of-#100326-upstream-release-1.20

Automated cherry pick of kubernetes#100326: Fix watchForLockfileContention memory leak
  • Loading branch information
k8s-ci-robot authored Jun 8, 2021
2 parents 9aae7d8 + 5149a75 commit 9e001aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/kubelet/app/server_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func watchForLockfileContention(path string, done chan struct{}) error {
}
if err = watcher.AddWatch(path, inotify.InOpen|inotify.InDeleteSelf); err != nil {
klog.Errorf("unable to watch lockfile: %v", err)
watcher.Close()
return err
}
go func() {
Expand All @@ -39,6 +40,7 @@ func watchForLockfileContention(path string, done chan struct{}) error {
klog.Errorf("inotify watcher error: %v", err)
}
close(done)
watcher.Close()
}()
return nil
}

0 comments on commit 9e001aa

Please sign in to comment.