Most small FastAPI services start on SQLite with PRAGMA journal_mode=WAL , pass local load checks, and stay quiet for months. Then one traffic burst hits a webhook endpoint or a background worker retries twenty jobs at once, and your logs fill up with sqlite3.OperationalError: database is locked .
I ran into this exact surprise while keeping webhook deduplication and small user-state tables inside a single-node FastAPI backend for an open Telegram Mini App ( https://github.com/angeldev-tech/ton-alpha-tma ). Turning on WAL felt like checking the "safe for concurrency" box. It was not.
The lock upgrade bug that skips busy_timeout
Even with journal_mode=WAL and busy_timeout=5000 , SQLite still allows only one writer at a time. That part is well known.…