Repository navigation
fix(db): set a busy_timeout PRAGMA for SQLite connections - #64301
Open
CarlSchwan wants to merge 1 commit into
Open
CarlSchwan wants to merge 1 commit into
CarlSchwan wants to merge 1 commit into
Conversation
SQLite's default busy timeout is 0, so a connection that finds the database locked by a concurrent writer fails immediately with "database is locked" instead of waiting briefly for the lock to clear. This is easy to hit even on small/single-user instances when two requests (e.g. a background poll and a user action) touch the DB at the same time. Add a 'sqlite.busy_timeout' config option (default 30000ms) wired through the same path as the existing 'sqlite.journal_mode' option, and apply it via PRAGMA busy_timeout in SQLiteSessionInit. Assisted-by: ClaudeCode:claude-sonnet-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
requested review from
Altahrim,
come-nc,
icewind1991 and
provokateurin
and removed request for
a team
September 14, 2026 09:58
come-nc
approved these changes
Sep 14, 2026
provokateurin
approved these changes
Sep 14, 2026
susnux
approved these changes
Sep 14, 2026
This branch has not been deployed
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.
Summary
SQLite's default busy timeout is 0, so a connection that finds the database locked by a concurrent writer fails immediately with "database is locked" instead of waiting briefly for the lock to clear. This is easy to hit even on small/single-user instances when two requests (e.g. a background poll and a user action) touch the DB at the same time.
Add a 'sqlite.busy_timeout' config option (default 30000ms) wired through the same path as the existing 'sqlite.journal_mode' option, and apply it via PRAGMA busy_timeout in SQLiteSessionInit.
The main usecase, is to avoid some flaky tests in the CI with this
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)