fix(FN-1001): fix retry race condition in executor and scheduler

- Executor skips redundant moveTask call on manual retry (was causing race with scheduler)
- Scheduler now triggers scheduling on todo column transitions to pick up retried tasks
- Add tests for retry race condition fix covering both executor and scheduler paths
This commit is contained in:
gsxdsm
2026-04-05 19:13:51 -07:00
parent f90739c8ba
commit 181ace2b27
4 changed files with 88 additions and 5 deletions

View File

@@ -191,11 +191,11 @@ export class Scheduler {
void this.handleMissionTaskCompletion(task.id, task.sliceId);
}
// Event-driven scheduling: when a dependency completes (task moves to "done"),
// Event-driven scheduling: when a task moves to "done" (completion) or "todo" (retry/manual move),
// trigger scheduling immediately so waiting tasks can start without waiting
// for the next poll interval (up to 15 seconds).
if (to === "done") {
schedulerLog.log("Task completed — triggering scheduling");
if (to === "done" || to === "todo") {
schedulerLog.log(`Task moved to ${to} — triggering scheduling`);
this.schedule();
}
});