Skip to content

fix(sqlite): configure busy_timeout on SQLite connections - #659

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/656-sqlite-busy-timeout
Aug 30, 2026
Merged

fix(sqlite): configure busy_timeout on SQLite connections#659
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/656-sqlite-busy-timeout

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Description

Resolves #656 by configuring PRAGMA busy_timeout = 5000; on SQLite connections:

  1. Lock Resilience:

    • Added PRAGMA busy_timeout = 5000; to the onOpen callback in SqliteConnection.connect().
    • Prevents immediate DatabaseException(database is locked / SQLITE_BUSY) failures when the SQLite file is concurrently accessed by background threads, file watchers, or other processes.
  2. Testing:

    • Added unit test in test/core/database/sqlite_connection_test.dart verifying that PRAGMA busy_timeout returns 5000 on connection open.
    • All tests pass with 0 analyze warnings.

Closes #656

- Configure PRAGMA busy_timeout = 5000 in SqliteConnection.connect() onOpen
- Prevent immediate SQLITE_BUSY / database locked errors during concurrent disk access
- Add unit test verifying PRAGMA busy_timeout on connection initialization

Closes #656
@github-actions github-actions Bot added bug Something isn't working error-handling Theme parser epic label: error-handling stability Theme parser epic label: stability storage Theme parser epic label: storage labels Aug 30, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 7e5d133 into dev Aug 30, 2026
4 checks passed
@ZhuchkaTriplesix ZhuchkaTriplesix mentioned this pull request Aug 30, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/656-sqlite-busy-timeout branch August 30, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working error-handling Theme parser epic label: error-handling stability Theme parser epic label: stability storage Theme parser epic label: storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant