Repository navigation
perf(daemon): reduce live catch-up amplification - #1430
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 11 minutes and 15 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Keep live full-ingest in-process by default so daemon catch-up does not leave a forkserver/resource-tracker pair around after small batches. Expand bounded append tails to 64 MiB so large live Codex appends do not fall back to full-session reprocessing.\n\nAlso make direct status fallback count FTS rows through the docsize shadow table instead of COUNT(*) on the FTS5 virtual table, which can hang on production-size archives.
9d2d3e1 to
4ac67ed
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d2d3e1daa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Reduce live daemon catch-up amplification found during production deployment of #1429. The change keeps daemon full-ingest parsing in-process by default, raises bounded append-tail ingestion to 64 MiB, removes an expensive FTS5 virtual-table count from direct
polylogue statusfallback, and treats client disconnects during daemon HTTP responses as normal disconnects rather than noisy internal errors.Problem
After deploying Polylogue
bdc1d724through Sinnix, the live daemon no longer hit the previous 6 GiB restart pattern in the first catch-up phase, but real workload still showed avoidable amplification: a forkserver/resource-tracker child remained after live full ingest, a large Codex append fell back into full-session reprocessing,polylogue --plain statushung on the production archive fallback path, and timed-out status probes generated BrokenPipe tracebacks in daemon logs.Solution
POLYLOGUE_LIVE_FULL_INGEST_WORKERSexplicitly opts into process workers.messages_fts_docsize, notCOUNT(*) FROM messages_fts.BrokenPipeError/ConnectionResetErrorfrom daemon handlers as client disconnects, not internal errors.Verification
pytest tests/unit/cli/test_status.py tests/unit/sources/test_live_watcher.py -q --tb=short-> 72 passed in 13.86spytest tests/unit/daemon/test_daemon_http_security.py tests/unit/cli/test_status.py tests/unit/sources/test_live_watcher.py -q --tb=short-> 258 passed in 16.40sruff format --check polylogue/sources/live/batch_support.py polylogue/cli/commands/status.py tests/unit/sources/test_live_watcher.py tests/unit/cli/test_status.py-> 4 files already formattedruff check polylogue/sources/live/batch_support.py polylogue/cli/commands/status.py tests/unit/sources/test_live_watcher.py tests/unit/cli/test_status.py-> All checks passedmypy polylogue/sources/live/batch_support.py polylogue/cli/commands/status.py tests/unit/sources/test_live_watcher.py tests/unit/cli/test_status.py-> Success: no issues foundmypy polylogue/daemon/http.py tests/unit/daemon/test_daemon_http_security.py-> Success: no issues founddevtools verify --quick-> all checks passed (36.6s total)