docs: search-index lock-acquisition order and threading model#138
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughDocuments ChangesFTS search documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/architecture.md`:
- Line 156: Update the Publish description for _publish_active_index so it does
not claim unconditional atomic pointer replacement; explicitly mention the
pointer.write_text fallback and qualify the reader guarantee to acknowledge
possible incomplete pointers, or remove that fallback from the implementation if
atomic publication is required.
- Line 158: Update the architecture documentation to distinguish rebuild
isolation from index_locked classification: explain that rebuilding a new SQLite
file does not normally lock the old active database, while query_index_hits
still classifies sqlite3.OperationalError as index_locked for fallback handling.
Avoid implying that rebuild concurrency inherently causes the error, and clarify
this distinction for follow-up tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 315eb35c-5452-4512-8803-b4baaaa035be
📒 Files selected for processing (2)
README.mddocs/architecture.md
e4d8f3c to
10e6b86
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 84: Update the README guidance for
CLAUDE_CODE_CHAT_BROWSER_NO_SEARCH_INDEX so it states that disabling the index
avoids using or building index files, rather than implying that existing index
files are removed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b567a1f-22b7-4ca1-ac0c-47b5289233d3
📒 Files selected for processing (2)
README.mddocs/architecture.md
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/architecture.md
Summary
docs/architecture.md.README.mdwarning against multi-worker Gunicorn/uWSGI on a shared index directory; point to single-worker orCLAUDE_CODE_CHAT_BROWSER_NO_SEARCH_INDEX=1.Docs-only (Week 30 item #6); defines the invariant for the follow-up concurrency suite (item #7).
Test plan
utils/search_index.py(lines 57–63, 187–219, 521, 641–693)Summary by CodeRabbit
GET /api/search?q=...documentation to reflect SQLite FTS5 querying when available, with a live JSONL scan fallback when the index is missing, stale, or temporarily locked.CLAUDE_CODE_CHAT_BROWSER_NO_SEARCH_INDEX=1.