perf: enable SQLite WAL journal mode and 5s busy timeout#667
perf: enable SQLite WAL journal mode and 5s busy timeout#667neuron-tech-ai wants to merge 1 commit into
Conversation
Switch from the default DELETE/ROLLBACK journal to WAL so concurrent readers (SSE status polls, history queries) are not blocked while the generation worker holds a write transaction. Set a 5-second busy timeout to eliminate "database is locked" errors under brief write contention. Both PRAGMAs are applied via a custom creator function so every connection in the pool gets the settings at open time, not just the first one.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
The default SQLite journal mode (DELETE/rollback) serializes all reads and writes — a write blocks all readers until it commits. Under concurrent API load (e.g., a generation in progress while the UI polls for updates), this produces "database is locked" errors.
WAL (Write-Ahead Logging) allows concurrent readers without blocking writers. Also adds a 5-second busy timeout so brief lock contention retries gracefully instead of immediately erroring.
Standard practice for SQLite in any multi-reader application.