Skip to content

fix(code-index): never join clone backfill from a freshness read - #1770

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
fix/nonblocking-clone-status
Sep 18, 2026
Merged

ScriptedAlchemy merged 1 commit into
masterfrom
fix/nonblocking-clone-status

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Reproduction

On the local current-master daemon, both tracedecay tool status and tracedecay status blocked past 90/30 seconds while clone backfill ran. Attaching gdb during the blocked request gave the exact stack:

std::sys::sync::mutex::futex::Mutex::lock_contended
LatestCodeTextGenerationV1::clone_index_status
dashboard_freshness_read

text_projection_needs_work already states and implements the invariant: a read probe must not queue behind an advance because backfill holds the slot for its whole bounded slice; contention itself means work is in progress. clone_successor_progress, called by clone_index_status, still used blocking lock_slot().

Checked #1577 first: it changes clone codec/decode, not clone_index_status, clone_successor_progress, or this lock.

Fix

clone_successor_progress uses try_lock and returns an explicit Busy read state. clone_index_status maps that to the existing typed status:

Unavailable { reason: "clone-index status is being updated" }

No guessed progress counters and no new wire state. The artifact/census read happens only after the slot snapshot succeeds.

Behavior test

dashboard_freshness_does_not_join_a_clone_backfill_slice drives a mounted registry, obtains ready text owners, holds the backfill slot, then calls the public dashboard freshness surface. It must return the typed busy clone status within 100 ms. The old code deadlocks on the held slot and fails the timeout.

Focused clone-status tests: 2/2. All dashboard-freshness runtime tests: 3/3. rustfmt and IDE lints clean.

A live blocked status request was waiting in clone_index_status on the clone
successor slot mutex. Backfill holds that lock for a whole bounded batch, so
status, dashboard freshness, unmounted-files, and doctor reads could stall for
30-120 seconds behind production work. Read the slot with try_lock instead;
a busy slot returns the typed unavailable clone-status snapshot immediately.
The dashboard-level regression holds the slot and requires that result within
100 ms.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d86fd22

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 b3e3d4a into master Sep 18, 2026
6 of 7 checks passed
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