Skip to content

fix: Indexing marker counts overlapping watcher windows; C# column defers ready while the embedder runs - #415

Open
flupkede wants to merge 2 commits into
developfrom
fix/indexing-marker-count
Open

flupkede wants to merge 2 commits into
developfrom
fix/indexing-marker-count

Conversation

@flupkede

Copy link
Copy Markdown
Owner

What

The watcher's text-indexing flows (detached HEAD-move branch refresh, FSW batch flush, symbol rebuild pass) share one IndexingOwner::Watcher marker per repo. As a boolean, the first flow to finish cleared it for the rest: a 758-second refresh healing 1241 files (13,198 chunks) read "idle" from the moment the two-minute symbol pass beside it ended — in the TUI, /status, the reindex 409 guard and GET /indexing?wait=.

Changes

  • The callback now counts open windows per alias (indexing_windows: WatcherWindows {open, oldest}); the marker stands until the last window closes and an unbalanced end saturates.
  • A leaked begin (a flow that panicked between its two calls) ages out with the marker's own timeout instead of keeping "Indexing" lit for the process lifetime.
  • Where a cached C# index status exists, the C# column reads Indexing while the embedder runs (and through the display hold); a repo/.sln without a C# index state never lights the column.
  • Follow-up (own commit): the literal-search seed() fixture redrives the transient Windows FTS commit race (os error 5) the same way the group-search fixtures already do — test-only churn, hit live in this branch's full-suite QC.

Validation

  • cargo fmt --all -- --check clean; cargo clippy --all-targets -- -D warnings clean.
  • cargo test --lib serve::tests -> 201 passed, 0 failed, incl. the four new tests; the overlap test was proven to fail on pre-fix code.
  • Full suite: 439 passed / 1 transient AV-race failure (passed on rerun, then hardened).

Test added 2 commits November 25, 2026 18:55
The watcher's text-indexing flows (detached HEAD-move branch refresh,
FSW batch flush, symbol rebuild pass) share one IndexingOwner::Watcher
marker per repo. As a boolean, the first flow to finish cleared it for
the rest: a 758-second refresh healing 1241 files (13,198 chunks) read idle from the
moment the two-minute symbol pass beside it ended, in the TUI, /status,
the reindex 409 guard and GET /indexing?wait=.

The callback now counts open windows per alias (indexing_windows:
{open, oldest}); the marker stands until the last window closes and an
unbalanced end cannot wrap the count. A window older than the marker
timeout has already lost its marker, so a count still including it is
a leaked begin (a flow that panicked between its two calls) — it is
dropped with the timeout instead of keeping the label lit for the
process lifetime. Empty-cleanup runs only at zero, inside the window
guard.

Where a C# index state exists, the C# column defers ready while the
embedder runs (and through the display hold): the text index belongs
to "C# ready". A .sln without a C# index state still never lights it.

Validation: cargo fmt --all -- --check clean; cargo clippy
--all-targets -- -D warnings clean; cargo test --lib serve::tests ->
201 passed, 0 failed (incl. overlapping_watcher_windows...,
a_leaked_watcher_window..., text_indexing_keeps...,
text_indexing_alone_never_lights...). The overlapping-windows test was
proven to fail on the pre-fix code (2026-11-25 session); the
follow-up tests pin the leak timeout and both halves of the C# gate.

Review-fixes:
- [Test] req 5 negative half untested (reviewer, tests.rs:5213) → added
  text_indexing_alone_never_lights_the_csharp_column: without a cached
  C# status the column keeps its probe result through a running embedder.
…t race

The seed() fixture committed its FTS docs with a bare unwrap; under
load the Windows AV/Search-Indexer segment race (os error 5) discards
the writer and the suite fails at random — observed live in this
branch's full-suite QC (search::literal::tests::empty_literal_falls_
back_to_relaxed, passed on rerun). Same redrive shape the group-search
fixtures and the production paths already use (is_transient_fts_commit_
error, fixture-sized backoffs): re-add the docs on a fresh writer, then
commit.

Test-only churn, no changelog entry.
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