This repository has been archived on 2026-10-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
barn/src
Daniel SamsonandClaude Opus 4.5 f916fc2f8b feat(jobs): add KILLED state for orphaned jobs with auto-retry
When the barn service is terminated unexpectedly (crash, SIGKILL), jobs
that were running are now marked as KILLED instead of FAILED. This
distinguishes between jobs that failed due to their own errors vs jobs
that were killed due to external factors.

Key changes:
- Add KILLED state to JobState enum
- Update JobStateMachine with KILLED transitions (RUNNING→KILLED, KILLED→QUEUED)
- CrashRecovery now marks orphaned jobs as KILLED and auto-retries them
- Add markKilled() method to JobRepository
- Add killed count to service status output
- Update HumanFormatter to display KILLED state in red

The auto-retry behavior uses exponential backoff (configurable) and
respects the maxRetries limit. Retry history is recorded in the
retry_history file.

Closes #25

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 01:08:05 +00:00
..