TIL: SQLite WAL Mode Can Lock Short-Lived Readers
Summary
This article examines how SQLite's WAL mode can briefly lock short-lived read-only readers due to the -shm coordination and a default zero busy timeout. It includes a Python-based repro illustrating scenarios with WAL and no busy timeout, WAL with a timeout, and DELETE mode, and recommends using a non-zero busy timeout or switching away from WAL in rare-read scenarios.