From 28f9453fbbbdc276e4b368d6e9076ecb508bd777 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 6 Apr 2016 17:39:13 -0700 Subject: [PATCH] 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 --- supervisor/worker.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supervisor/worker.go b/supervisor/worker.go index 88314ff..c4493ac 100644 --- a/supervisor/worker.go +++ b/supervisor/worker.go @@ -53,7 +53,9 @@ func (w *worker) Start() { continue } 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 { logrus.WithField("error", err).Error("containerd: add process to monitor")