Error oom if container has not stopped

The oom control file may not exist if the container is short lived and
exits before we can open it.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-04-06 17:39:13 -07:00
parent 1bb6821084
commit 28f9453fbb

View file

@ -53,7 +53,9 @@ func (w *worker) Start() {
continue continue
} }
if err := w.s.monitor.MonitorOOM(t.Container); err != nil && err != runtime.ErrContainerExited { if err := w.s.monitor.MonitorOOM(t.Container); err != nil && err != runtime.ErrContainerExited {
logrus.WithField("error", err).Error("containerd: notify OOM events") if process.State() != runtime.Stopped {
logrus.WithField("error", err).Error("containerd: notify OOM events")
}
} }
if err := w.s.monitorProcess(process); err != nil { if err := w.s.monitorProcess(process); err != nil {
logrus.WithField("error", err).Error("containerd: add process to monitor") logrus.WithField("error", err).Error("containerd: add process to monitor")