feat(tasks): add coalescing queue and task lifecycle guards
- Coalescing queue: use HasPendingTaskForIssue (queued/dispatched only) instead of HasActiveTaskForIssue so comments during a running task enqueue exactly one follow-up task that picks up all new comments. - Stale task cleanup: runtime sweeper now fails orphaned tasks when their runtime goes offline (daemon crash/network partition). - Cancel-aware daemon: handleTask checks task status after execution and discards results if the task was cancelled mid-run (e.g. reassign). - Terminal issue guard: ClaimTaskForRuntime auto-cancels pending tasks for done/cancelled issues instead of executing them. - Race condition safety net: unique partial index ensures at most one pending task per issue at the DB level.
This commit is contained in:
parent
32f795e1ef
commit
b112d1f1ae
13 changed files with 148 additions and 3 deletions
1
server/migrations/022_task_lifecycle_guards.down.sql
Normal file
1
server/migrations/022_task_lifecycle_guards.down.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
DROP INDEX IF EXISTS idx_one_pending_task_per_issue;
|
||||
Loading…
Add table
Add a link
Reference in a new issue