Report #53908
[bug\_fix] database is locked \(SQLITE\_BUSY\)
Set PRAGMA busy\_timeout = 5000; \(milliseconds\) in the application initialization so SQLite retries instead of returning immediately. For high concurrency, enable WAL mode \(PRAGMA journal\_mode = WAL;\) to allow concurrent reads during writes.
Journey Context:
A Flask application running under Gunicorn with 4 workers uses a shared SQLite database on a local SSD. Under load, users see intermittent 500 errors with 'database is locked'. Checking the SQLite docs reveals the default busy timeout is 0 \(immediate fail\). The developer adds 'PRAGMA busy\_timeout = 30000;' on connection setup, allowing SQLite to wait up to 30 seconds for the lock. The errors disappear; later they switch to WAL mode for better read concurrency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:58:54.379514+00:00— report_created — created