Skip to content

Sandbox OOM is reported as a route timeout instead of a structured termination reason #92

Open

Description

@rcyw

Problem

When a sandbox is terminated by OOM, a subsequent business operation can fail with a generic route timeout instead of an actionable termination reason. Users cannot distinguish a sandbox memory limit failure from a routing or infrastructure outage through akernel-sdk alone.

Observed in a private deployment: sandboxd recorded OOMKilled:true, while later process-list or command-start requests returned the following sanitized response:

HTTP 500
{"code":500,"message":"wait for instance <sandbox-id> route: context deadline exceeded","data":null}

OOM was confirmed from service-side evidence, not inferred from the HTTP error or exit code. No independent reproduction has been completed on an unmodified upstream release, and the deployment is not claimed to match the public source revision below.

Public source observations

This should be tracked across the service API and SDK: the SDK cannot reconstruct a termination reason that the service has discarded or failed to associate with a request.

Expected behavior and acceptance criteria

  • Preserve a sandbox terminal record with a machine-readable reason, exit time, and exit code when available. Document its retention period after runtime and route cleanup.
  • For a confirmed sandbox OOM, subsequent operations return a specific termination error promptly instead of waiting for a route timeout. A code such as SANDBOX_OOM_KILLED is illustrative, not a required API name.
  • Expose the terminal reason through a documented API/SDK query and an identifiable SDK error, without requiring users to access cluster credentials or operator logs.
  • Distinguish OOM, normal completion, explicit deletion, and node loss. Unknown reasons remain unknown; neither exit code 128/137 nor a route timeout alone proves OOM.
  • Add integration coverage for OOM followed by command/process queries and terminal-state retrieval after cleanup, plus tests for the other termination paths. OOM of an individual child process must not automatically classify a still-running sandbox as terminated.

Proposed upstream reproduction (not yet executed)

  1. Create a disposable sandbox with a small, enforced memory limit.
  2. Run a workload that triggers termination of the sandbox and verify a reliable runtime/cgroup OOM signal.
  3. Call process-list/command-start and the SDK state query using the same sandbox ID.
  4. Check whether the client receives and can query the OOM reason after runtime/route cleanup.

The report intentionally omits private cluster identifiers, endpoints, credentials, and raw business logs.

Activity

  1. added
    bug
    on Oct 12, 2026
  2. rcyw commented on Oct 12, 2026

    @rcyw
    CollaboratorAuthor
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions