Repository navigation
Vouch request: fix for SQLite "database is locked" (#3679) #5103
fitzyracing1
started this conversation in
Vouch Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm @fitzyracing1. I'd like to contribute a fix for #3679, the intermittent
(code: 5) database is lockederror inpersistence/sqlite.rs.kvnloo handed the issue to me on Oct 3, and I posted my stress-test findings there on Oct 7. In short, no single path holds the write lock for more than 5s. Instead, a waiting writer gets starved by a steady stream of short writes. The same error has since shown up in the #4408 test on the Windows MSVC lanes and on a real gateway with two clients (#4591).
The fix sets the 5s
busy_timeoutexplicitly and adds an in-process first-come, first-served write queue toSqliteStore. It covers every write path, including the image transaction insandbox_image.rs. Reads and the startup migration aren't gated. I tested it with 50 ms added to every disk sync. The #4408 concurrent-writes test passed 30/30 runs with the fix and 0/30 on main. On a normal disk, both passed 100/100. The fullopenshell-serverlib suite passes, and fmt and clippy are clean. I haven't run the E2E or Windows tests.The change is ready as #5102, which was auto-closed pending a vouch. I'm happy to adjust the approach based on maintainer feedback.
All reactions