Run Timeout Enforcement #77

Open
opened 2026-02-23 10:06:49 +00:00 by ottomata · 0 comments
Owner

Tasks

  • jobs.timeout_secs field already exists in the schema (added in Phase 3.1)
  • In run_service.go TriggerRun:
    • If job.TimeoutSecs != nil, create a context.WithTimeout for the run
    • Pass the timeout context to the executor
  • When the context deadline is exceeded:
    • The executor cancels the process (SIGTERM to process group) — already handled by executor's ctx
    • Run service detects the context.DeadlineExceeded error
    • Updates run status to timed_out
  • Write integration test: run a script that sleeps for 10s with a 2s timeout → verify timed_out status

Acceptance Criteria

  • Jobs with timeout_secs set are killed after the specified duration
  • Timed-out runs have status timed_out and a correct ended_at timestamp
  • Jobs with timeout_secs = null run without any time limit
  • Integration test passes
### Tasks - [ ] `jobs.timeout_secs` field already exists in the schema (added in Phase 3.1) - [ ] In `run_service.go` `TriggerRun`: - If `job.TimeoutSecs != nil`, create a `context.WithTimeout` for the run - Pass the timeout context to the executor - [ ] When the context deadline is exceeded: - The executor cancels the process (SIGTERM to process group) — already handled by executor's ctx - Run service detects the `context.DeadlineExceeded` error - Updates run status to `timed_out` - [ ] Write integration test: run a script that sleeps for 10s with a 2s timeout → verify `timed_out` status ### Acceptance Criteria - [ ] Jobs with `timeout_secs` set are killed after the specified duration - [ ] Timed-out runs have status `timed_out` and a correct `ended_at` timestamp - [ ] Jobs with `timeout_secs = null` run without any time limit - [ ] Integration test passes
ottomata added this to the Phase 8 project 2026-02-23 10:09:19 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ottomata/acsm#77
No description provided.