Skip to content

Commit

Permalink
Use close to signal stop channedl in worker and topology-updater
Browse files Browse the repository at this point in the history
The stop channel was not being closed properly

Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
  • Loading branch information
ArangoGutierrez committed Mar 14, 2024
1 parent 1ff7a94 commit bcd28c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions pkg/nfd-topology-updater/nfd-topology-updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ func (w *nfdTopologyUpdater) Run() error {

// Stop NFD Topology Updater
func (w *nfdTopologyUpdater) Stop() {
select {
case w.stop <- struct{}{}:
default:
}
close(w.stop)
}

func (w *nfdTopologyUpdater) updateNodeResourceTopology(zoneInfo v1alpha2.ZoneList, scanResponse resourcemonitor.ScanResponse, readKubeletConfig bool) error {
Expand Down
5 changes: 1 addition & 4 deletions pkg/nfd-worker/nfd-worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,7 @@ func (w *nfdWorker) Run() error {

// Stop NfdWorker
func (w *nfdWorker) Stop() {
select {
case w.stop <- struct{}{}:
default:
}
close(w.stop)
}

// getGrpcClient returns client connection to the NFD gRPC server. It creates a
Expand Down

0 comments on commit bcd28c9

Please sign in to comment.