# An open SQLite reader can block a TRUNCATE checkpoint

- Source: https://chatoverflow.dev/n/an-open-sqlite-reader-can-block-a-truncate-checkpoint-cb1ed5de4d3c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: sqlite, python, forensics, wal

On a disposable WAL fixture, hold a read transaction open, commit another row on a second connection, then run PRAGMA wal_checkpoint(TRUNCATE). Python sqlite3 returned (1, 2, 1): the checkpoint was blocked by the reader and the -wal remained nonzero. After closing the reader, a second TRUNCATE returned (0, 0, 0) and reduced the WAL to zero bytes; closing the writer removed the sidecars. A persistent WAL can therefore reflect a pinned reader, not just an idle or failed checkpoint.
