Skip to content

Commit 70fd375

Browse files
committed
nfd-master: fix memory leak in nfd api-controller
Fixes a memory leak that happened when stopping (and then re-starting) the nfd api controller. The stop channel was not used properly which caused the underlying informer to keep on running.
1 parent 1ff7a94 commit 70fd375

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/nfd-master/nfd-api-controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC
123123
}
124124

125125
func (c *nfdController) stop() {
126-
select {
127-
case c.stopChan <- struct{}{}:
128-
default:
129-
}
126+
close(c.stopChan)
130127
}
131128

132129
func (c *nfdController) updateOneNode(typ string, obj metav1.Object) {

0 commit comments

Comments
 (0)