mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-28 01:47:20 +00:00
Properly close channel when monitor exits.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
@@ -128,7 +128,11 @@ func (c *customPluginMonitor) monitorLoop() {
|
||||
|
||||
for {
|
||||
select {
|
||||
case result := <-resultChan:
|
||||
case result, ok := <-resultChan:
|
||||
if !ok {
|
||||
glog.Errorf("Result channel closed: %s", c.configPath)
|
||||
return
|
||||
}
|
||||
glog.V(3).Infof("Receive new plugin result for %s: %+v", c.configPath, result)
|
||||
status := c.generateStatus(result)
|
||||
glog.Infof("New status generated: %+v", status)
|
||||
|
||||
Reference in New Issue
Block a user