drivers: OOM kill logging for Docker driver (#17518)

Explicit error log of the docker ID and container image name
This commit is contained in:
Johan Forssell
2023-06-26 10:13:23 +02:00
committed by GitHub
parent 555214199a
commit 5b46b74b94

View File

@@ -246,6 +246,13 @@ func (h *taskHandle) run() {
if ierr != nil {
h.logger.Error("failed to inspect container", "error", ierr)
} else if container.State.OOMKilled {
h.logger.Error("OOM Killed",
"container_id", h.containerID,
"container_image", h.containerImage,
"nomad_job_name", h.task.JobName,
"nomad_task_name", h.task.Name,
"nomad_alloc_id", h.task.AllocID)
// Note that with cgroups.v2 the cgroup OOM killer is not
// observed by docker container status. But we can't test the
// exit code, as 137 is used for any SIGKILL