This is happening each time I'm restarting the Akonadi server, during this time Kontact is using 100% CPU and is hardly usable. This goes on for around one minute and then these entries in the log just vanish, Kontact's CPU usage goes down and Kontact starts getting usable. Log excerpt: ``` ... akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Executing search "kontact-476707713-SearchSession" akonadiserver(27868)/org.kde.pim.akonadiplugin_indexer: unknown(0): unknown term "birthday" @ ?akonadiserver?|qt_message_output|QDebug::~QDebug|?akonadi_search_plugin.so?|?akonadi_search_plugin.so?|?akonadi_search_plugin.so?|?akonadiserver?|?akonadiserver?|?akonadiserver?|?akonadiserver?|QMetaObject::activate|QMetaObject::activate|?libQt5Network.so.5?|?libQt5Network.so.5?|?libQt5Network.so.5?|QCoreApplication::notifyInternal2|?libQt5Core.so.5?|g_main_context_dispatch|?libglib-2.0.so.0?|g_main_context_iteration akonadiserver(27868)/org.kde.pim.akonadiplugin_indexer: unknown(0): unknown term "birthday" @ ?akonadiserver?|qt_message_output|QDebug::~QDebug|?akonadi_search_plugin.so?|?akonadi_search_plugin.so?|?akonadi_search_plugin.so?|?akonadiserver?|?akonadiserver?|?akonadiserver?|?akonadiserver?|QMetaObject::activate|QMetaObject::activate|?libQt5Network.so.5?|?libQt5Network.so.5?|?libQt5Network.so.5?|QCoreApplication::notifyInternal2|?libQt5Core.so.5?|g_main_context_dispatch|?libglib-2.0.so.0?|g_main_context_iteration akonadiserver(27868)/org.kde.pim.akonadiplugin_indexer: unknown(0): Got 10219 results akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Search done "kontact-476707713-SearchSession" (without remote search) akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Result: 10219 matches akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): SEARCH: akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Query: "{\n \"limit\": -1,\n \"negated\": false,\n \"rel\": 0,\n \"subTerms\": [\n {\n \"cond\": 2,\n \"key\": \"birthday\",\n \"negated\": false,\n \"value\": 2458228\n },\n {\n \"cond\": 4,\n \"key\": \"birthday\",\n \"negated\": false,\n \"value\": 2458235\n }\n ]\n}\n" akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): MimeTypes: ("text/directory") akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Collections: QVector(0, 1081, 3267, 3055, 3148, 3260) akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Remote: false akonadiserver(27868)/org.kde.pim.akonadiserver: unknown(0): Recursive true ... ```
Akonadi version: 4:17.12.3-0ubuntu3
Still experiencing this every time I restart the akonadiserver (which I have to do often b/c of mail sync stopping to work... -- different issue). Could someone tell me how I can figure out the root cause of this particular issue?
Whenever something changes in Akonadi we need to re-run persistent search queries to update the content of the "Search" folders in KMail, because currently there's no other way to figure out whether the new email matches the search filter or not (it's not run on every single change, but it is scheduled to run in about a second after the first change). If the query affects many collections or has many results (like in your case, 10219), it can hinder the performance. A workaround is to remove the persistent search folders from KMail (which sucks, I know...) Proper fix, of course, is for me to figure out how to match a single email against the search query so we can evaluate it on per-email basis instead of having to re-run the entire search query every time.
> A workaround is to remove the persistent search folders from KMail (which sucks, I know...) How do I do that? Note: Akonadi version now is: 4:18.04.3-0ubuntu2 (problem still persists)