docker/docker — pull request #9246 by estesp (2014-11-19 20:16:09+00:00)
Title: Proposal: Add "OOM killed" event based on OOM state information

Currently, libcontainer supports the proper cgroups method (using eventfd) to get OOM notification when memory constraints are used with a container. This information makes its way all the way back into the container ExitStatus object (see https://github.com/docker/docker/blob/master/daemon/execdriver/native/driver.go#L164) which is received by the container monitor (see https://github.com/docker/docker/blob/master/daemon/monitor.go#L137) , but a gap exists in that the OOM information isn't reflected back into the container `State`, only the exit code: https://github.com/docker/docker/blob/master/daemon/monitor.go#L172-L173

This proposal would add the OOM exited boolean as well as a `LogEvent` call for a new event, `"oom"` (or another name, if preferable.. `"oomkill"`, `"oomdie"`, ?