Skip to content

bug(sandbox): runnerd refuses every exec into a full session even when none is running #4718

Closed

Description

@yannickmonney

Summary

Runnerd refuses POST /execs with 429 session_memory_busy once the session's working set reaches TALE_EXEC_ADMISSION_MEMORY_PERCENT (default 90 %) of its memory limit (services/sandbox-runtime/daemon/src/main.ts:344-358, session-memory.ts:130-139). The refusal exists to protect the execs that are running — but it applies just the same when execManager.liveCount() is 0. Verified on main at 73d03a9.

A session can sit above the threshold with nothing running: containers the agent started on the session's inner Docker engine and the engine itself, tmpfs/shmem pages, and active page cache (the working set subtracts only inactive_file, so cache from a big build that is still on the active list counts until the kernel needs it). In that state every start is refused. The platform's session client retries a few times, then the lane waits for "sandbox room" and keeps asking (services/platform/backend/core/node_only/sandbox/helpers/session_client.ts:2230-2246, core/automations/agent_host.ts:1409). Each refused request also enters the activity gate with markUsed (main.ts:584, activity-gate.ts:30-33), clearing released, so a release-based reclaim cannot free the session either. The run waits out its deadline although no work in the session could ever finish and free the memory.

Suggested fix

  • Admit the exec when execManager.liveCount() === 0: no running exec can lose to it, and the kernel reclaims cache for the new one under the limit.
  • Optionally, before refusing, ask the kernel to reclaim (memory.reclaim, Linux 5.19+) and read again.
  • Report a full-but-idle session distinctly so the platform can recycle it instead of waiting.

Unit test with a fake cgroup root (TALE_CGROUP_ROOT) at 95 % and no live exec: the exec is admitted.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    ac91986
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-readybugpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions