Enable busy_timeout + foreign_keys for multi-writer safety#101
Open
Dmheath1 wants to merge 3 commits into
Open
Enable busy_timeout + foreign_keys for multi-writer safety#101Dmheath1 wants to merge 3 commits into
Dmheath1 wants to merge 3 commits into
Conversation
WAL mode was already set; add busy_timeout=5000 and foreign_keys=ON to complete the standard 3-pragma incantation for concurrent SQLite use. Patches src/db.ts and both dist/ compiled outputs. Adds WAL smoke test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Thanks for the contribution. Would you mind resubmitting this without a change to the version number inside the mcp? |
The previous rebuild swept the bundled VERSION literal up to match package.json (1.4.2). Reverting to 1.4.1 per maintainer request — version bumps are owned by the maintainer, not this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Done. VERSION revert in a470b5f. PR diff is now just the two PRAGMA lines plus the smoke test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiple Claude Code sessions concurrently writing to the same SQLite store produces corruption. better-sqlite3 doesn't enable WAL by default (though this repo already set it). The PRAGMAs added here are standard for any multi-process SQLite:
Applied to all three Database connection points: `src/db.ts` (main writer), `dist/mcp-server.js` (separate MCP-server writer that wasn't covered by the existing sync-cli lock), and `src/stats.ts` (readonly connection that can still hit busy during WAL checkpoint).
Includes a vitest concurrent-read-during-write smoke test.