pkg/oom/v2: handle EventChan routine shutdown quietly
When the cgroup is removed, EventChan is closed (this was pulled in by
8d69c041c5
). This results in a nil error
being received. Don't log an error in that case but instead return.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
604c462d7b
commit
821c961c86
@ -102,10 +102,13 @@ func (w *watcher) Add(id string, cgx interface{}) error {
|
|||||||
i.ev = ev
|
i.ev = ev
|
||||||
w.itemCh <- i
|
w.itemCh <- i
|
||||||
case err := <-errCh:
|
case err := <-errCh:
|
||||||
i.err = err
|
// channel is closed when cgroup gets deleted
|
||||||
w.itemCh <- i
|
if err != nil {
|
||||||
// we no longer get any event/err when we got an err
|
i.err = err
|
||||||
logrus.WithError(err).Warn("error from *cgroupsv2.Manager.EventChan")
|
w.itemCh <- i
|
||||||
|
// we no longer get any event/err when we got an err
|
||||||
|
logrus.WithError(err).Warn("error from *cgroupsv2.Manager.EventChan")
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user