Skip to content

feat(sandbox): report a Kubernetes session the OOM killer restarted as out of memory, not lost #4724

Closed

Description

@yannickmonney

Summary

On Docker, the spawner tells a session that the kernel's OOM killer ended from one that was simply lost: DockerSessionBackend.takeOutOfMemory reads State.OOMKilled from the inspect it already makes (services/sandbox/src/backend/docker/docker-session-backend.ts:774-812), running execs end with SESSION_OOM (services/sandbox/src/session/session-routes.ts:2253-2254,3547-3559), and the platform waits before retrying (resource_exhausted). Verified on main at 73d03a9.

KubernetesSessionBackend does not implement takeOutOfMemory (services/sandbox/src/backend/kubernetes/k8s-session-backend.ts), and session Pods run with restartPolicy: Always (k8s-session-pod-spec.ts:290,373): a runner container the OOM killer ended restarts in place, its execs end as SESSION_LOST, and they are retried at once — into the same limit, with a message that does not mention memory. (Execs the kernel kills inside a surviving container are attributed on Kubernetes too, through runnerd's own oomKilled; this gap is the container itself.)

Suggested fix

Implement takeOutOfMemory for Kubernetes from the Pod status the backend already reads: the runner container's lastState.terminated.reason === 'OOMKilled' with a restartCount above the one last seen for the session. Test with a fake Pod status.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    0729e08
  3. added a commit that references this issue on Oct 30, 2026
    7bc2509
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

    agent-readyimprovementpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions