Switch sqlite3 journal mode to WAL.
WAL mode does make the deadlocking on MacOS go away. This suggests that pysqlite3 was leaving *read* transactions open for a long time; in old-style sqlite journals, this prevents anyone from obtaining a write lock, although it doesn't prevent other concurrent reads. With WAL journals, writes can happen even while readers are holding a lock, but the journal doesn't flush until the readers have released it. This is not a "real" fix but it's fairly harmless, since all redo instances will exit eventually, and when they do, the WAL journal can be flushed.
This commit is contained in:
parent
613625b580
commit
5156feae9d
1 changed files with 1 additions and 1 deletions
2
state.py
2
state.py
|
|
@ -14,7 +14,7 @@ STAMP_MISSING='0' # the stamp of a nonexistent file
|
|||
def _connect(dbfile):
|
||||
_db = sqlite3.connect(dbfile, timeout=TIMEOUT)
|
||||
_db.execute("pragma synchronous = off")
|
||||
_db.execute("pragma journal_mode = PERSIST")
|
||||
_db.execute("pragma journal_mode = WAL")
|
||||
_db.text_factory = str
|
||||
return _db
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue