Repository navigation
Commit bcd086b
authored
fix(scheduling): settle expandable-node request correlation on non-dispatch paths (#189)
* fix(scheduling): settle expandable-node request correlation on non-dispatch paths
MC-3: submit mints a full request-correlation record set for every
non-caller job, including needs-deferred dynamic-matrix nodes. Those nodes
route to expansion and never dispatch to a runner, so no completion, result
patch or disconnect ever settles their records. On every path where such a
node concludes without dispatching, the record leaked in `inflight_requests`
and `session_active_requests` with `result: None`, staying renewable and
resolvable to a job expansion had already deleted from the run.
Settle the record (result recorded, out of inflight + every session) exactly
as the completion path would, on all non-dispatch conclusions:
- run cancel (`cancel_run_inner`): use a run-wide `expandable_job_ids` set
instead of the narrow caller_plans-only collection.
- job cancel (`cancel_job_inner`): settle via `is_expandable_node`.
- submit-time workflow-concurrency overflow cancel (`submit_run_inner`).
- dependency skip / `if:` eval error (`promote_ready_jobs` Skip/Error arm).
Reusable callers mint no records at submit, so retiring them is a no-op;
Settle is idempotent, so overlapping paths cannot double-settle harmfully.
Adds tests covering all four non-dispatch conclusions.
* fix(scheduling): settle expandable nodes with their concluded status, not hardcoded Cancelled
Codex review (P2): a nested reusable caller that finished Success while the
run stayed active remains in `run.caller_plans` with an unsettled request
record (`register_expanded_jobs` mints it; `propagate_reusable_outputs`
retires none). The run-wide `expandable_job_ids` sweep then passed it to
`Settle(Cancelled)`, corrupting the persisted request result to Cancelled
while `run.jobs` still said Success.
Settle each expandable node with `node_settle_status` — its own verdict from
`run.jobs`, defaulting to Cancelled for a node the run no longer records.
Freshly-cancelled placeholders (already flipped to Cancelled by the status
loop) still settle Cancelled; an already-terminal caller keeps its result.
Also drops the now-redundant narrow `deferred_matrix` settle block in
`cancel_job_inner` that the unified `is_expandable_node` path supersedes.
Adds `cancel_preserves_completed_reusable_caller_result` covering the exact
nested-caller scenario.1 parent 081e787 commit bcd086b
3 files changed
Lines changed: 735 additions & 44 deletions
0 commit comments