Skip to content

sqlite: _busy_timeout/_journal_mode DSN params are ignored by modernc (busy_timeout=0 in server/ingestor) #576

Closed

Description

@dborup

Found in the #571 review (Minimax). modernc.org/sqlite v1.34.5 silently ignores mattn-style DSN parameters such as _journal_mode and _busy_timeout; its applyQueryParams only handles _pragma, _time_format and _txlock.

Affected call sites:

  • cmd/server/db.go:211
  • cmd/server/ping_score_history.go:451
  • cmd/ingestor/admin_delete_client_rx.go:104

Verified: OpenDB on a WAL file reads back busy_timeout=0. WAL mode only holds because the file is already WAL.

Impact: server readers and ingestor writers get an immediate SQLITE_BUSY instead of waiting. This plausibly explains intermittent "database is locked" errors in tests and possibly in production.

Fix: switch to _pragma=busy_timeout(N) and _pragma=journal_mode(WAL), which is the modernc syntax, in every DSN. Add a test that opens each DSN and asserts the effective PRAGMA busy_timeout and journal_mode. The server must stay mode=ro (Kpa-clawbot#1283).

Relates to #571 / #567.

Activity

  1. dborup commented on Oct 25, 2026

    @dborup
    OwnerAuthor

    Fixed by #578 (merged as 81c798e47d47d990017a67d94ec7dbb5c558a3a3).

  2. added a commit that references this issue on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions