fix(automation): recheck cancellation before journal reservation - #1187
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6159eb61d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let live_admission = context | ||
| .clone() | ||
| .with_cancellation(cancellation.context()) | ||
| .admission_at(live_at); |
There was a problem hiding this comment.
Recheck admission inside the reservation worker
When the blocking pool is saturated, cancellation or deadline expiry can occur after this live check but before the spawn_blocking closure reaches reserve_or_replay_indexed_blocking; the closure will then still create the pending-index entry and durable journal reservation. This leaves the exact cancellation/timeout window the change is intended to close and can cause a cancelled run to be recovered or executed later, so the check must be performed at the actual reservation boundary rather than before scheduling the worker.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Performance Comparison
|
e8b9467
into
codex/tracedecay-total-redesign-plan-reopened
Fixes defects introduced by #1181 and #1180, found in independent review.
test(automation)+fix(automation): recheck cancellation before journal reservation— refactor(automation): move effect settlement into runtime #1181 hoisted admission out of the settlement kernel so it ran before retirement classification (aspawn_blockingfile read); a run cancelled during classification then proceeded to reserve durable journal state. The kernel now re-evaluates the live cancellation signal (CancellationSignal::context()re-reads the atomic) and the deadline against a freshtracedecay_contracts::try_now_micros()immediately beforereserve_or_replay_indexed_blocking— the durable boundary, with nothing durable between — mappingCancelled/TimedOutto the typedPreAdmissionProblem.observed_atstays the pinned admission instant on the durable record. RED→GREEN:cancelled_after_admission_does_not_reserve_journaland the timeout twin both assert the journal file and recovery index are empty.refactor(automation): keep one pre-admission gauge authority—observe_admission_decisioninsettlement.rsis the single owner ofdaemon.effect_admission.refused.pre_admission_total; root's own early pre-admission refusal calls it, so the census has no hole and the "every effect settles into exactly one outcome" doc holds.fix(daemon-service): surface host admission recovery at warn— refactor(lifecycle): move replay, PR git kernels, and query wait to owners #1180 moved the replay worker from the unconditional daemon log totracing::info!, soprofile_host_admission_bootstrap_recovered/_retryvanished under the default WARN filter; raised to WARN (thestopped/exhaustedeventsbranch_admin.rsasserts were already WARN and are untouched).refactor(code-index-runtime): single disable check for deferred mounts—code_index_disabled_for_scopewas checked in both the root spawn wrapper and the runtime helper; the unreachable runtime copy and the dead_scopeparameter are gone, and the two invariant comments refactor(lifecycle): move replay, PR git kernels, and query wait to owners #1180 dropped (lagged receiver; once-a-second polling cost) are restored.Verification: settlement 59; root
daemon::automation_effect9; deferred-mount 3; clippy-D warnings --testson automation-runtime, daemon-service, code-index-runtime (lib) and root; fmt; commitlint. Two independent Opus passes; second pass's items (stale-clock deadline recheck, gauge hole, dead parameter) fixed and folded. The only clippy noise left in this area is the pre-existingformat_collectincode_index_scheduler/tests.rs, fixed separately in #1184.