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

Đang mở Phù hợp với người mới
#451 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@erain đang làm issue này rồi.

Từ ngày 13/10/2026.

  • #458 của @erain — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
documentation

Hướng nghiên cứu

Đọc docs/runner.md và so sánh mô tả về suspend với hành vi được quan sát trong issue: suspend tạo checkpoint và đóng băng sandbox mà không gửi tín hiệu, và chỉ /workspace được giữ lại một cách đáng tin cậy. Cập nhật tài liệu để làm rõ rằng spec.command có thể chạy trong quá trình golden boot và có thể chạy lại sau khi tiếp tục; endpoint /suspend được đề xuất là công việc tiếp theo tùy chọn, không bắt buộc đối với thay đổi tài liệu này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

devx

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 (#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.

Ngôn ngữ chính
Go
Star
14.8k
Fork
802
Merge trung bình
18 giờ 37 phút
Pull request đã merge (30 ngày)
110

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/ax

Tất cả issue của google/ax

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.