Issue
Sentry Issue: NUXEO-DRIVE-VT and a lot more.
OperationalError: database is locked File "nxdrive\engine\watcher\remote_watcher.py", line 608, in _handle_changes File "nxdrive\engine\activity.py", line 228, in func_wrapper File "nxdrive\engine\watcher\remote_watcher.py", line 693, in _update_remote_states File "nxdrive\engine\watcher\remote_watcher.py", line 665, in _get_changes File "nxdrive\engine\dao\sqlite.py", line 380, in store_int File "nxdrive\engine\dao\sqlite.py", line 365, in update_config File "nxdrive\engine\dao\sqlite.py", line 142, in execute File "nxdrive\engine\dao\sqlite.py", line 136, in execute
Analysis
The way the database does its commit is prone to deadlocks, resulting in lot of "database is locked" errors.
The current journal_mode used is MEMORY, and here is what the doc states:
The MEMORY journaling mode stores the rollback journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the database file will very likely go corrupt.
New Mode
We should use another journal_mode: WAL. According to the documentation, we will have only benefits. All disadvantages listed do not impact our product or how we use SQLite inside, which is quite interesting.
- is duplicated by
-
NXDRIVE-2288 Documents missing
- Resolved
- is related to
-
NXDRIVE-2365 Remove all database-related files on account removal
- Resolved
-
NXDRIVE-2377 Force database commit before generating a report
- Resolved
-
NXDRIVE-581 Optimize remote scan local processing: SQLite insertion duration is increasing along with the number of rows
- Resolved
- Is referenced in