-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite database is locked error #1670
Comments
Also wanted to ask why it is using IMMEDIATE transaction mode? :)
|
Unfortunately setting max pool size to 1 makes things worse, or just reveals a bigger problem. Instead of randomly raising the exception, it just times out at first big query like key value store Lately i am having a lot of SQLITE_BUSY exceptions in signal-cli, my application stops at least once a day because db was busy, and doesn't want to recover. |
sqlite does support multiple read connections at the same time, though every write will block the database. Enabling WAL might help here. I've enabled WAL mode in e11e093, can you try the latest master if it works better? |
By default, SQLite doesn't support multiple connections.
It can be enabled either with a shared cache or write-ahead log feature.
Default connection # for Hikari: DEFAULT_POOL_SIZE = 10,
which under the load produces exceptions:
org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
I'd advise doing
in
org.asamk.signal.manager.storage.Database#getHikariDataSource
or trying enabling WAL with PRAGMA (not sure it will solve the issue completely though, if two connections will try to write simultaneously).More info:
https://stackoverflow.com/questions/10325683/can-i-read-and-write-to-a-sqlite-database-concurrently-from-multiple-connections
The text was updated successfully, but these errors were encountered: