Skip to content

fix(sqlite): add PRAGMA busy_timeout=30000 to all thread-local store connections - #942

Open
bradbrok wants to merge 1 commit into
mainfrom
fix/sqlite-busy-timeout
Open

fix(sqlite): add PRAGMA busy_timeout=30000 to all thread-local store connections#942
bradbrok wants to merge 1 commit into
mainfrom
fix/sqlite-busy-timeout

Conversation

@bradbrok

Copy link
Copy Markdown
Owner

Summary

Files changed: activity_store, agent_comms, conversation_store, dream_runner, hooks, presentation_store, research_store, session_store (both store classes), skill_store, task_store, trigger_store, user_profile_store, voice_store — one line added per _db property.

Test plan

  • test_mixed_crud_hammer_uses_thread_local_connections — was failing, now passes
  • tests/pinky_federation/ (152 tests) — still passing
  • ruff check clean on all changed files
  • Full CI run on push

Generated by Claude Code

…connections

The 5-second default SQLite busy timeout (sqlite3.connect default) is
insufficient when multiple FastAPI worker threads write concurrently to
the same database — the serialized write queue can exceed 5 s under
moderate load or on slower disk (e.g. Pi, constrained containers).

Adds PRAGMA busy_timeout=30000 (30 s) after journal_mode=WAL on every
per-thread connection opened by the 13 stores converted to thread-local
connections in #929/#933/#934/#937. Fixes test_mixed_crud_hammer_uses_
thread_local_connections which was failing reproducibly in this
environment with OperationalError('database is locked').

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E6DxbrbMeuTFwTTBVEqbC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants