Repository navigation
fix(linux-sqlite): tell a locked file apart from a full server - #3585
Merged
Merged
Conversation
…the reopened file
…-message # Conflicts: # linux/ROADMAP.md
…-message # Conflicts: # linux/crates/app/src/ui/error_text/tests.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A save into a SQLite file another program holds locked said "The server has no room for another connection right now". SQLite's
SQLITE_BUSYmapped to the sameDriverError::Busythe server engines use for a full server or pool. The SQLite doc also said lock contention shows only atBEGIN IMMEDIATE, but in a rollback-journal file a reader elsewhere makes theCOMMITfail too.Change
DriverError::Busycarries aBusyReason:NoFreeConnectionfor the server engines and the pool wait,FileLockedforSQLITE_BUSY. The app wordsFileLockedas another program or an editor tab with an open transaction holding the file's lock. The other engines keep their message.SQLITE_LOCKEDis now the server's own error: without a shared cache it is a conflict inside one connection.BEGIN IMMEDIATEfor a writer,COMMITfor a reader in rollback-journal mode, never for a reader in WAL), and release criterion 5 moves to Holds today.Verified
file_locked.rsholds a real lock from a second connection and checks a structure change, a commit held up by a reader, an import, an editor run, reads and opening the file: each fails asBusy(FileLocked)and the file keeps none of the save.write_batch_takes_write_lock_before_probeandsession_read_concurrent_with_workspace_write_busy_or_commit_never_hangsnow expectFileLocked.Not in this PR