Handle OOM event.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-06-23 00:29:30 +00:00
parent f33514afdb
commit a2f6f7f128
3 changed files with 30 additions and 7 deletions

View File

@@ -120,6 +120,13 @@ func (c *criContainerdService) handleEvent(e *task.Event) {
return
}
case task.Event_OOM:
// TODO(random-liu): [P1] Handle OOM event.
err := c.containerStore.Update(e.ID, func(meta metadata.ContainerMetadata) (metadata.ContainerMetadata, error) {
meta.Reason = oomExitReason
return meta, nil
})
if err != nil && !metadata.IsNotExistError(err) {
glog.Errorf("Failed to update container %q oom: %v", e.ID, err)
return
}
}
}