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
database is locked #55
Comments
Can you set verbose=1 with the latest git , and share messages before and after the error ? |
Received One
|
The indexer had successfully completed an index operation before and after this problem at exactly the same minute/second. |
Hello, can you try with additional updates ? |
Upgraded and watching. |
Do you have a process of expunging the mailbox in parallel to main core binary ? |
Yes.
The following expunge rules are defined in the dovecot local.conf file:
The Junk and Backups/baobab mailbox expunge rules get executed when a new email arrives. They get executed often because backups occur in the evening at ~ 22:00 and, well, we get a lot of Junk/Spam. |
Maybe the sqlite timeout should be increased. What is the timeout? https://sqlite.org/c3ref/busy_timeout.html Is the code using sqlite wal mode? Is the sqlite code in dovecot or fts-xapian? |
All sqlite calls are in fts-xapian. |
I upgraded now. Also, it's happening to another email account too. |
One yesterday. Two today. |
I increased the timeout to see |
I used the 100 timeout on 2020-10-16. I received one "database is locked" on 2020-10-17. I changed 100 -> 500. |
Please, @grosjo, for what is SQLite used? Cannot this be stored directly into xapian DB? AFAIK, the timeout is in msec. Default timeout in Python & Exim is 5000 msec, Dovecot uses 1000 msec. IMO 100 msec is too low. |
I used SQlite to handle expunges outside xapuan, as xapian does not explicitely handle concurrency. https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/concurrency.html Does 5000 timeout solve the issue ? |
Actually tried with https://tartarus.org/james/xapian-apidoc/html/namespaceXapian.html#a296fe000d6d9525bb8e80f72838026a6 Make sense ? |
I cannot comment xapian locking, but if i properly understand provided link, there will be no timeout, but infinite waiting for lock, i am not sure if it is good idea. I can comment SQLite locking, but i have only basic C/C++ experiences, thus i didn't inspect your code (i will lost in int), thus some of my notes can be applied already (you simple ignore them):
Using WAL mode can improve performance, especially it will allow concurrent write/read access. Its setting is persisent and can be enabled/disabled anytime, even by CLI tool. It can little slowdown reads, but concurrent access can improve it at all. Because it is persistent, it can be enabled on DB file creation (only once) and because it is not error to enable it more time, it can be enabled ag. in time plugin initialization, to ensure enabling it for existing DB file . |
Please kindly test again, and let me know. |
An sqlite3_busy_timeout of 500 works for me. Now upgrade with the latest. |
Problem fixed in fee8502. |
I am getting occasional errors in dovecot:
fts-xapian: 68ea96 (master)
OS: Debian Linux testing/bullseye
Dovecot: v2.3.11.3 (latest)
The text was updated successfully, but these errors were encountered: