Bug 337366

Summary: akonadi sqlite lockup when checking imap resources
Product: [Frameworks and Libraries] Akonadi Reporter: Christian Quast <wildcart>
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: crash CC: dvratil
Priority: NOR    
Version: 4.13   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christian Quast 2014-07-11 13:13:43 UTC
Since upgrading to 4.13 I am experiencing lockup problems using akonadi's sqlite backend. At a random point after starting akonadi / kontact, akonadi gets stuck when syncing folders or retrieving mails. The process list in kontact (status bar lower right side) shows something like "syncing folder XXX %Y" but it stays at Y%. At that point a cannot access any mails, calendar items, or contacts. 

Running akonadi from console I get a debug message:
  "[QSQLITE3: 140502062065408] " sqlite3_blocking_step: Entering while loop

Searching for this on the Internet I'll find among other things a commit message removing the code to print this message: http://permalink.gmane.org/gmane.comp.kde.cvs/1316401 (message date Apr. 6 2014 - Enable concurrency in our copy of QSQLITE driver) and other links pointing to older(?) versions (ie. 1.3.90) of akonadi where the code seems to active. After restarting akonadi (`akonadictl stop`, wait until akonadi server exits which takes a 20 seconds or so and then `akonadictl start`) everything works find for a while - sometimes a could of hours up to a day.

I found a similar bug report from Nov. 2012 which might be related but in my case everything works fine until a certain point (not gettings stuck in init). Also, I am able to normal close the applications and stop akonadi (which takes some time though): https://bugs.kde.org/show_bug.cgi?id=310652

Maybe of interest: I have to IMAP accounts set-up and two DavCal Groupware resources (a total of 3 address books + 1 calendar / 1 task imported from the first resource, and 6 calendars / 6 tasks imported from the second source).

Platform: opensuse 13.1 using the KDE stable build service

Software versions:
akonadi-4.13.2-10.1.x86_64
plasma-addons-akonadi-4.13.2-4.1.x86_64
python-kde4-akonadi-4.13.2-4.2.x86_64
libakonadiprotocolinternals1-1.12.1-3.1.x86_64
akonadi-runtime-1.12.1-3.1.x86_64
libakonadi4-4.13.2-4.1.x86_64
kontact-4.13.2-10.1.x86_64
kmail-4.13.2-10.1.x86_64


PS: I cannot simply switch to other backends as I am running akonadi / kontact on a thin client set-up (SunRays) host multiple users and starting a database server on such a system wouldn't be my first choice.

Reproducible: Always

Steps to Reproduce:
1. start akonadi and kontact
2. work normally and wait
Actual Results:  
At some point (hours up to a day) akonadi / kontact gets stuck when trying to sync IMAP folders / mails.

Expected Results:  
Folders / Mails will be synced
Comment 1 Daniel Vrátil 2014-07-14 16:53:52 UTC
The errors you are seeing are from the version before I enabled the concurrency (that will be available in Akonadi 1.13).

You can try switching to the QSQLITE backend (the one shipped with Qt, now you are using QSQLITE3, the patched one we ship with Akonadi), which has absolutely no concurrency and all transactions are strictly serialized. Since they are both SQLite backends, the storage format is compatible, so all you need to do is to change ~/.config/akonadi/akonadiserverrc: in [%General] change Driver=QSQLITE3 to Driver=QSQLITE and rename the [QSQLITE3] section to [QSQLITE].

Make sure to stop Akonadi before trying this.
Comment 2 Christian Quast 2014-07-14 17:01:29 UTC
I just switched over to the QSQLITE driver as suggested. Lets see...

I'll report back on failure or success.
Comment 3 Christian Quast 2014-07-18 10:30:08 UTC
I've been using the QSQLITE driver for almost four days now and I didn't need to restart akonadi during this time. It seems as if the problems have been solved.

thanks...
Comment 4 Allen Winter 2014-10-04 16:32:20 UTC
then let's resolve this. thanks for the report.