Gate: every indexer test that can reach flush/apply_resolution must hold RESOLVE_HOOK_LOCK (5th recurrence) #311
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#311
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?
FAIL_NEXT_COMMITSandFAIL_NEXT_RESOLVEare process-global test seams.RESOLVE_HOOK_LOCK's doc requires every test that can triggerflushorapply_resolutionto hold the lock. Nothing enforces that, and it has now failed five times:packaged_profile_isolation_testswith "injected busy (test seam)".watcher::tests::a_cancelled_directory_reconcile_indexes_nothingcalledindex_pathunguarded. A parallelthe_shutdown_flush_gives_up_after_its_capthen counted 6 commit attempts where it injects for 3. Fixed in5e76fc9on the integration branch.Each time the fix was one more
let _g = RESOLVE_HOOK_LOCK.lock(). That is a fix per case, not a mechanism.Wanted: one structural gate.
Option A, preferred if it is simple: make the seam per-connection or per-thread instead of process-global, so no test can see another test's injection. Then the lock and its rule disappear.
Option B: a registry test that scans
#[cfg(test)]code incrates/indexerand fails on any#[test]fn that can reachindex_path,flush, the writer loop orapply_resolutionwithout takingRESOLVE_HOOK_LOCK. Use the index (find_callers) or a source scan, whichever is sound.Test for the fix: remove the lock from one test; the gate must turn RED (option B), or the cross-test interference must become impossible (option A).
Verified complete under the issue's preferred option A. Commit
09dc0bbeaereplaces the process-global injections and RESOLVE_HOOK_LOCK with database-scoped seams; it is an ancestor of published v0.41.34. Separate connections to the same database intentionally share its injection, while a different project's database cannot consume it. Guards remove the entry when the test ends.Revalidated on candidate
d641f8ec:seams_are_scoped_to_their_own_databaseandno_unkeyed_process_global_test_seam_existsboth pass within the full indexer suite (598 passed, 4 existing ignored). The isolation test performs real indexing of database B while A is armed to fail commits and resolution, verifies B resolved references and did not consume A's injections, then proves those injections reach A through a separate writer connection. The permanent registry test also rejects an unregistered process-global test seam. Existing recorded mutations document both negative controls.The requested mechanism is already shipped and its regression controls remain green; closing without another code change or CI run.