Skip to content

Only set sqlite WAL on file creation to allow for concurrent runs on Windows#1402

Merged
f-f merged 5 commits into
masterfrom
f-f/windows-wal-corruption
May 31, 2026
Merged

Only set sqlite WAL on file creation to allow for concurrent runs on Windows#1402
f-f merged 5 commits into
masterfrom
f-f/windows-wal-corruption

Conversation

@f-f
Copy link
Copy Markdown
Member

@f-f f-f commented May 28, 2026

After parallelising the test suite in #1395, we are now often getting these failures for the Windows CI (e.g. this one:

Error: disk I/O error
  code: 'ERR_SQLITE_ERROR', errcode: 1546, errstr: 'disk I/O error'
  at Module.connectImpl (.../Spago.Db/foreign.js:17:6)

I think this happens because on Windows PRAGMA journal_mode = WAL calls winTruncate on the wal-index file (the .shm) and concurrent runs that go through this mean that each one sees an inconsistent state.
Since according to the docs the WAL mode is persistent across database reopens, we only need to run the pragma once on file creation.

@f-f f-f merged commit 7a331a0 into master May 31, 2026
5 checks passed
@f-f f-f deleted the f-f/windows-wal-corruption branch May 31, 2026 10:26
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.

1 participant