-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
CI failed with database is locked
#6066
Comments
'database is locked
database is locked
5 is SQLITE_BUSY, but it indeed should never happen, probably |
Another failure (on ubuntu-latest), this time about
It sends a message internally, so could be the same problem. |
Running |
With much more logging I collected these errors:
So all sorts of JSON-RPC requests fail, even plain |
WAL documentation has this list of reasons |
We have a very limited API in Currently I plan to try:
|
I tried setting |
Will try to set |
I made a PR that rules out the possibility of us accidentally writing to a read connection: #6076 |
I cannot reproduce it anymore, but probably because of the network conditions change or something like that. Don't think it is fixed for real, but without the ability to reproduce it cannot debug it further. |
Now that we have If it does not negatively affect performance, having a separate connection instead of toggling Even without dedicated write connection, write mutex is better moved inside the See discussion at #6076 (comment) |
Still, seems we need to be prepared for this. Just in case citing https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode here to not forget about it:
|
But we are never closing connections, so how can this happen? Connections returned to the pool are not closed. |
You're right, but then there's another problem that WAL swells indefinitely. E.g. my WAL now is ~200M which is much more than 1000 pages (SQLITE_DEFAULT_WAL_AUTOCHECKPOINT macro). |
Strange, the largest WAL I have here is 8.7M. |
My DC Desktop is running since Sep 21, maybe this is the reason? |
I think I found the reason: we run
Here is the code that should run from deltachat-core-rust/src/sql.rs Lines 718 to 725 in 61fd0d4
This is also what happens in recent CI failures:
We run housekeeping once on just created contexts, so it makes sense that this affects the tests. |
We can already close this issue as |
Regarding WAL I opened an issue #6089 |
#6087 is merged but there was another failure: |
Let's close this until it fails again, at least now failures should be greatly reduced as incremental_vacuum does not happen on read connection immediately after account creation. |
Here is a failure log:
We should at least add more context to this error to know which SQL query failed. But if it is an
SQLITE_LOCKED
, this should never happen and it indicates there is some problem with converting read transaction to write transaction. Maybe someINSERT
withSELECT
that should be wrapped into immediate transaction to avoidSELECT
getting a read lock that needs to be later converted to write lock or something like this?The text was updated successfully, but these errors were encountered: