You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: status-aware task Submit with Run counter and livez endpoint (Alpha P3) (#61)
## Summary
Cloud-API model for the sidecar task engine: the controller submits
stable keys, and the sidecar owns the execution lifecycle.
- **Status-aware `Submit`**: failed tasks are transparently re-executed
on re-submit; running/completed are idempotent no-ops
- **`Run` counter** on `TaskResult`: tracks execution count under the
same stable ID. Increments on failed→re-execute, NOT on crash-recovery
rehydration
- **Concurrency safety**: `sync.Mutex` + `inFlight` map prevents
double-execution of the same failed task ID
- **`/v0/livez` endpoint**: SQLite liveness check via `Ping()` —
distinct from `/v0/healthz` (readiness). Use as Kubernetes liveness
probe.
- **SQLite migration v3**: adds `run` column
### Why
Deterministic task IDs + PVC-persisted SQLite = permanently stuck failed
tasks after pod restart. The engine's dedup check returned the cached
failure without re-executing. This is the sidecar half of the Alpha P3
task reliability initiative. The controller half (plan IDs, simplified
retry, failure diagnostics) follows in a separate PR on
sei-node-controller-networking.
## Test plan
- [x] `TestSubmitReExecutesFailedTask` — failed task re-executes, Run
increments to 2
- [x] `TestSubmitReExecutesFailedTaskThatFailsAgain` — persistent
failure increments Run
- [x] `TestSubmitDoesNotIncrementRunOnRehydration` — crash recovery
preserves Run=1
- [x] `TestSubmitConcurrentSameFailedID` — mutex prevents
double-execution
- [x] `TestSubmitRunFieldOnFirstSubmit` — new tasks start at Run=1
- [x] `TestLivezReturns200WhenStoreHealthy` /
`TestLivezReturns200BeforeReady`
- [x] All 40+ existing engine, server, and store tests pass
- [x] `go vet` clean
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments