Watcher/writer: files on disk drop out of the live index after churn (dir bounce, git stash pop) and never heal until the 30-min reconcile #381
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#381
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the 2026-10-15 review and reproduced on 0.39.0 (
d79756f1). Pre-existing.Repro
mv crates/ignoreaway and back 0.4 s later.crates/ignore/srcare still on disk but gone from the index, still gone after 105 s. 17 paths are lost in total.index_freshnessreportsstate: lagging, added: 17, so it measures the loss but nothing acts on it.index_coveragetells the agent "picks new files up in about a second — retry", which is false.git stash && git stash poploses files the same way (delete-recreate with identical content): aStatTouchlands on a row that was already deleted. A new file renamed away before its insert commits leaves a phantom row.Root cause
Decisions are made against the committed read connection while the writer still has messages queued.
soft_rewalk(watcher.rs~1949) sends aWithdraworDeletefor paths the racing walk did not see.StatSkipagainst the old committed row.Direction
Two generic fixes:
Deleteonly if the path is absent;Withdrawonly if classification now says skip; aStatTouchthat updates 0 rows becomes a re-parse.freshness::comparemeasuresadded/changed, enqueue those paths.Test: a deterministic storm harness that compares the settled live index with a cold index of the same tree on files, symbols, refs and binds.
Released in v0.40.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.40.0, PR #388, merge
a48fb945): every watcher write is checked against the disk as it applies; an edit/rename/delete storm ends equal to a cold index;index_freshnessre-queues lagging paths; the pathless-event panic that killed the watcher thread on Linux is fixed; mass deletes 8.4 s → 0.48 s for 10,000 files. zammad-dev has been asked to retest their live-deletion probe on 0.40.