Skip to content

The reason field isn't set to OOMKilled for containers killed immediately after start #8180

Closed as not planned

Description

@mimowo

Description

We observed that, occasionally, the reason field for Kubernetes containers which are oom killed immediately after their start is set to Error rather than OOMKilled.

This was discovered by a recently added e2e node test in k/k, see related issue: kubernetes/kubernetes#116082.

Steps to reproduce the issue

  1. Run via Kubernetes a container with memory restricted to 15M, and using with the following command sh -c "dd if=/dev/zero of=/dev/null bs=20M"

Note that, it fails only occasionally.

Describe the results you received and expected

The reason field set to OOMKilled.

What version of containerd are you using?

1.6.12-0ubuntu022.04.1gke1

Any other relevant information

Example containerd logs from a failed k/k test:

Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.360444314Z" level=debug msg="Finish redirecting stream \"stdout\" to log file \"/var/log/pods/oomkiller-test-8138_oomkill-target-pod_b53d7fb0-9151-4f0e-870a-ffbccd16f809/oomkill-target-container/0.log\""
Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.396182820Z" level=debug msg="event forwarded" ns=k8s.io topic=/tasks/oom type=containerd.events.TaskOOM
Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.396518375Z" level=debug msg="Received containerd event timestamp - 2023-02-26 12:05:17.395915965 +0000 UTC, namespace - \"k8s.io\", topic - \"/tasks/oom\""
Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.396864926Z" level=info msg="TaskOOM event &TaskOOM{ContainerID:46390b63528810c6bc07c965dfdc4f91f3d9c503e8de1f64bb9509e2f13a8c94,XXX_unrecognized:[],}"
Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.398091484Z" level=debug msg="event forwarded" ns=k8s.io topic=/tasks/start type=containerd.events.TaskStart
Feb 26 12:05:17 tmp-node-e2e-169abffc-ubuntu-gke-2204-1-24-v20230222 containerd[1178]: time="2023-02-26T12:05:17.405313372Z" level=info msg="StartContainer for \"8421aeb51bfcb395c8fda0423e90b2408df13439fd1a73fdf3210091ea1d3080\" returns successfully"

Note that the TaskOOM event is logged before StartContainer for \"container_id\" returns successfully. In successful runs of the test the StartContainer for \"container_id\" returns successfully is logged before TaskOOM .

Show configuration if it is related to CRI plugin.

No response

Activity

  1. mimowo commented on Feb 28, 2023

    @mimowo
    Author
  2. mimowo commented on Mar 7, 2023

    @mimowo
    Author
  3. SergeyKanzhelev commented on Mar 10, 2023

    @SergeyKanzhelev
    Contributor

    Can you link the containerd issue here and close this bug than? I tend to agree. Thank you!

  4. mimowo commented on Mar 10, 2023

    @mimowo
    Author

    This is the PR that fixed the issue from the test stability POV in k/k: kubernetes/kubernetes#116082

  5. mikebrow commented on Aug 8, 2023

    @mikebrow
    Member

    quick scan of the log ^

    first stand out:

    Jul 23 18:56:46 tmp-node-e2e-92a26bb7-cos-97-16919-353-1 containerd[910]: time="2023-07-23T18:56:46.424828104Z" level=debug msg="containerEventsChan is full, discarding event {ContainerId:98bac6c4b73cfd4c647647aa80248208b67de059874d4ddfdd1aa43ea3967e54 ContainerEventType:CONTAINER_STOPPED_EVENT CreatedAt:1690138606424696583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions