Skip to content

docs/runner.md says suspend sends SIGTERM, but suspend freezes the sandbox without any signal #451

Open

Description

@mastersingh24

docs/runner.md says "Stop and suspend both deliver SIGTERM to PID 1." In practice, suspend doesn't send any signal. Substrate checkpoints the sandbox and freezes it, so a runner that waits for SIGTERM to flush state never gets the chance. We saw the same on Agent Substrate v0.1.0-gke.1 and v0.3.0.

Example: a command that logs when it starts and when it gets SIGTERM, writing to the durable volume:

apiVersion: ax.io/v1alpha1
kind: Task
metadata:
  name: term-test
  atespace: default
spec:
  image: "<runner image>@sha256:..."
  command:
    - sh
    - -c
    - |
      log() { echo "$(date +%T) $*" >> /workspace/term.log; }
      trap 'log got-SIGTERM; exit 0' TERM
      log "started pid=$$"
      while true; do sleep 1; done
  debug: true
$ ax resume task term-test
$ ax suspend task term-test
$ ax resume task term-test
$ ax ssh term-test -- cat /workspace/term.log
22:25:18 started pid=9
22:26:00 started pid=10

There's no got-SIGTERM line. On v0.3.0 the command simply starts again after resume (new PID), while PID 1 still has the golden boot's start time. On v0.1.0-gke.1 the process memory came back from the golden snapshot instead. Either way, the only thing that reliably survives a suspend is /workspace. Files in /tmp and processes started after the golden boot are gone.

Suggested fix

  • Correct docs/runner.md: suspend is a checkpoint with no signal, only /workspace survives, and the command may be started again on resume. It would also help to say plainly that spec.command can run during the golden boot (spec.command also runs in the golden boot #428), since that's part of the same picture for runner authors.
  • If a graceful suspend is wanted, ax could ask the runner before calling SuspendActor. For example, a POST /suspend on the runner's port 80 that forwards SIGTERM to the command's process group and waits (with a deadline) for it to exit or acknowledge.

Note: I opened #446 on the assumption that suspend sends SIGTERM. That request still makes sense for stop and delete, but it won't help suspend.

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. erain commented on Oct 13, 2026

    @erain
    Collaborator

    I am taking this on. I will correct the suspend lifecycle descriptions in docs/runner.md and docs/sandbox.md, verify the behavior against the pinned local AX/Substrate lab, and include reproducible commands and captured output in the PR. I will keep graceful-suspend implementation out of this documentation change.

  3. added
    devx
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

devx

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions