mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #100326 from wzshiming/fix/memory-leak
Fix watchForLockfileContention memory leak
This commit is contained in:
commit
10b09e8a46
@ -29,6 +29,7 @@ func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
}
|
||||
if err = watcher.AddWatch(path, inotify.InOpen|inotify.InDeleteSelf); err != nil {
|
||||
klog.ErrorS(err, "Unable to watch lockfile")
|
||||
watcher.Close()
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
@ -39,6 +40,7 @@ func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
klog.ErrorS(err, "inotify watcher error")
|
||||
}
|
||||
close(done)
|
||||
watcher.Close()
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user