Repository navigation
fix(loop): reject fast-exit detached runs; sync turn-counter docs - #477
Merged
Merged
Conversation
Two follow-ups to the detached-run and turn-provenance fixes: 1. Detached-run liveness check. `spawn` succeeding only means the child was created, not that it re-dispatched correctly. A mis-dispatched re-exec (e.g. the child drops a group layer and lands on an unrelated command) exits instantly with a usage error while the parent printed a fake pid and returned success. Give the child a short grace window, then bail with a pointer to the detached log when it has already exited. 2. Doc sync. The goal-level monotonic turn counter landed in #474 but the `DecisionSummary::turn` field and `record_turn_decision` docs still described the old run-local counter. Update both to the goal-level semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-ups to the detached-run (#473) and turn-provenance (#474) fixes.
1. Detached-run liveness check
spawnsucceeding only means the child process was created, not that itre-dispatched correctly. A mis-dispatched re-exec (e.g. the child drops the
loopgroup and lands on the unrelated one-shotfuture run, which rejects--goal) exits instantly with a usage error — while the parent printed a fakepid and returned success, leaving the orchestrator to discover a dead worker
later.
This change gives the child a short grace window (120 ms), then
try_waitsit: if the child has already exited,
cmd_runbails with a pointer to thedetached log instead of reporting a fake pid.
2. Doc sync for the turn counter
The goal-level monotonic turn counter (
base_turn+global_turn) landed in#474, but
DecisionSummary::turnandrecord_turn_decisionstill describedthe old run-local counter. Updated both doc comments to the goal-level
semantics.
Tests
cargo check -p future-loop✅cargo test -p future-loop --lib quota::decision_summary✅ (2 passed)cargo test -p future-loop --test quota_read_model_contract✅ (8 passed)