sqlite: enable WAL + busy_timeout in connect(); 408/413/429 transient #62
Reference in New Issue
Block a user
Delete Branch "feature/sqlite-wal-and-413-transient"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The DB connection helper now sets
journal_mode=WAL,busy_timeout=5000,and
synchronous=NORMALon every connection. 13+ DAOs each open theirown connection through this helper and share one SQLite file — without
WAL, a writer's exclusive lock blocks readers and
load_personsracingthe face-watch write storm errored instantly with "database is locked".
GPU face inference made this visible by speeding detect ~10× and
flooding the writer side. WAL persists in the file once set so the
debug binaries that bypass connect() inherit it automatically.
Also widen face_client.rs's classifier: 408 / 413 / 429 are now Transient
instead of Permanent. These are operator-fixable proxy/infra errors;
marking them Permanent poisons every affected photo with status='failed'
and requires manual SQL to recover. Specifically, Apollo's nginx
defaulted to a 1 MB body cap and silently rejected normal-size photos
before they reached the backend — the deferred-and-retry contract is
the right behavior for that class of fault.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com