Skip to content

fix(code-index): end every seat wait through one authority - #2823

Merged
ScriptedAlchemy merged 4 commits into
masterfrom
fleet/audit-leftovers-scheduler-signals
Oct 2, 2026
Merged

ScriptedAlchemy merged 4 commits into
masterfrom
fleet/audit-leftovers-scheduler-signals

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Refs #2405, #2365, #2550, #2612

Recovered from the audit-leftovers/scheduler-signals lane, which died in the 2026-10-01 restart; re-verified after rebasing on 134157d. The lane's #2209 (MemoryRefusalRetryV1) item was not started and is not in this PR.

Changes

  • Store-lock-refused first open waits on the release (fix(code-index-runtime): retry generation reads a store writer blocks #2405 pattern). A cold mount whose first open_with_policy is refused by a contended store lock now waits for the holder's release, a kernel lock wait on a dedicated thread raced against the reservation's cancellation, then reopens. Before, it surfaced as a failed mount. wait_for_code_generation_store_release takes the lock exclusively so a refused writer also outlasts readers.
  • One seat-wait authority (fix(code-index): end fresh and ready waits after the graph tail #2365/fix(code-index): verify restarts and wait for the retained seat #2550/fix(daemon): serve cold-daemon reads once their owner is ready #2612 pattern). Every wait for a worktree's seat (decoded generation, current text owner, text serving under a query authority, readiness target) goes through one wait. It subscribes to the root's publication, seat, mount, pass and park signals before the first probe and re-probes only when the registry publishes a change. Its outcome is typed: CodeIndexSeatWaitV1 is seated / parked (CodeIndexSeatParkV1: worker park with remedy, unpublished, publication unreadable, seated-but-not-serving, unreachable readiness) / cancelled / deadline. The advisory runtime's separate wait_for_generation_change loop and the compiler-diagnostics producer's own wait are deleted in favour of it. Seat parks map without a reason table.
  • Publication-gate wait wakes on shutdown, not a poll.

Evidence (rebased tree)

  • tracedecay-code-index-runtime lib 562 passed (1 ignored), tracedecay-code-index-retention lib 114, tracedecay lib (advisory/deferred/activation selection) 35, full daemon_suite 57 (all pass). New tests: a_first_mount_refused_by_a_held_store_lock_mounts_on_its_release, a_seat_wait_answers_a_parked_worker_with_its_park, a_readiness_wait_ends_when_the_registry_is_cancelled, owner_signals_wake_on_their_own_roots_publication, store_release_wait_outlasts_a_reader.
  • I did not build master to run the new tests there. They target behaviour master doesn't have: a store-lock-refused cold mount fails outright on master, and CodeIndexSeatWaitV1 doesn't exist.
  • clippy -D warnings (code-index-runtime, code-index-retention, tracedecay, --all-targets, test features), cargo fmt --all -- --check: clean. Windows cross-check: exit 0 (the one BRANCH_TRACKING_FAILED dead-code warning is pre-existing).
  • Known limit: on shutdown the release-wait thread is detached, not interrupted. It ends when the holder releases or the process exits.

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c5137f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit 60fce0d into master Oct 2, 2026
6 of 7 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fleet/audit-leftovers-scheduler-signals branch October 2, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant