This repository was archived by the owner on Jun 24, 2026. It is now read-only.
Repository navigation
Commit c547a06
committed
fix: switch SQLite from WAL to DELETE journal mode to prevent corruption
WAL mode relies on shared memory (mmap) and POSIX file locking via the
-shm file, both of which are unreliable across Docker volume mounts on
macOS. When two instances share the same database through bind mounts,
the broken mmap coordination causes silent data corruption
(SQLITE_CORRUPT).
Switch to DELETE journal mode which eliminates the -shm shared memory
dependency entirely. Add EXCLUSIVE locking mode so the process holds
the database lock for its connection lifetime — a second instance gets
a clear SQLITE_BUSY error instead of silent corruption.
Performance impact is negligible since opencode uses a single connection
per process, making WAL's concurrent-read advantage unused.
Closes anomalyco#141941 parent 8b99648 commit c547a06
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments