Bug 373443 - Mail Dispatcher Agent spins at 100% CPU after upgrade from 4:16.08.2+p16.04+git20161117.2322-0 to 4:16.08.3+p16.04+git20161207.0319-0
Summary: Mail Dispatcher Agent spins at 100% CPU after upgrade from 4:16.08.2+p16.04+g...
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Mail Dispatcher Agent (show other bugs)
Version: 5.3.2
Platform: Neon Linux
: NOR normal with 35 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 373441 373442 373444 373989 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-08 22:20 UTC by Gunter Ohrner
Modified: 2019-06-25 20:42 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunter Ohrner 2016-12-08 22:20:56 UTC
After today's KDE Neon update from Akonadi 4:16.08.2+p16.04+git20161117.2007-0 to 4:16.08.3+p16.04+git20161208.0216-0, Mail Dispatcher Agent spins at 100% CPU.

It starts doing this immediately after login and also continues immediately after an "akonadictl restart".

Upon "akonadictl stop", Mail Dispatcher Agent crashes instead of shutting down cleanly.
Comment 1 Gunter Ohrner 2016-12-09 09:10:53 UTC
In Akonadi console, this Agent is never displayed as running or online, but labeled with an unconnected plug icon and shown as offline. Meanwhile, it's happily spinning away, eating CPU and causing lots of noise due to the CPU fan having to run at full speed...

The only workaround I could find so far was entirely removing this Akonadi Agent using the Akonadi console.

However, obviously, I cannot send any mails any more using kMail if I do this, so this also is not really an option... :-/

I can live without the other agents which cause trouble since the update, but I clearly cannot properly work without the Mail Dispatcher Agent... :-(

What option's do I have to determine why this agent is not initialising correctly but (apparently) enters an infinite loop instead? What's it doing?
Comment 2 Gunter Ohrner 2016-12-09 09:12:19 UTC
BTW, I also tried removing and re-adding this agent using Akonadi console, but this also did not help / did not change anything.
Comment 3 Gunter Ohrner 2016-12-09 09:18:23 UTC
stracing the process shows just this:

read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
read(10, "", 16384)                     = 0
Comment 4 Tomasz C. 2016-12-20 05:47:39 UTC
Can you fix it:
lsof -p <pid>

Example return:
...
akonadi_m 3035 user   10r      REG                8,3      324 3807516 /home/user/.config/akonadi/agent_config_akonadi_migration_agent_changes.dat

- stop akonadi,
- rename file agent_config_akonadi_migration_agent_changes.dat
- start akonadi

The same for the other akonadi process (100% CPU)
Comment 5 Laurent Montel 2016-12-20 17:10:43 UTC
There is a fix for 100% CPU in akonadi master 98e72dd81f3b8d5faeb262f765cda9539d1c271f

Are you able to rebuild akonadi with this patch ?
Comment 6 Rewarp 2016-12-28 16:29:37 UTC
I can confirm Tomasz's solution fixes the problem on openSUSE Tumbleweed. I only noticed the problem when KMail failed to send my messages in my outbox, presumably because of the saturation of the CPU processes.

Thanks for the suggestion.
Comment 7 Gunter Ohrner 2017-01-06 10:01:23 UTC
@Laurent: Sorry for the late reply. As kMail did not work for me any more with this bug, I had to switch to Thunderbird for the meantime - and I did not notice that I had not subscribed to the IMAP folder where my KDE Bugzilla notifications end up, so I missed your question... :-(

(I configured kMail to show all folders regardless of subscription state.)

So that I've now seen your question (and tons of others) is an indication that it's working for me again since yesterdays update. :)

Interestingly, KDE PIM Runtime which contains the mail agent was not changed during this update, but Akonadi was upgraded to 4:16.12.0+p16.04+git20170104.0343-0 (KDE Neon package).

So if this fix was contained therein, it helps. If it wasn't, the issue was caused by something else.
Comment 8 Daniel Vrátil 2017-01-06 21:54:55 UTC
*** Bug 373444 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Vrátil 2017-01-06 21:57:03 UTC
*** Bug 373441 has been marked as a duplicate of this bug. ***
Comment 10 Daniel Vrátil 2017-01-06 21:57:20 UTC
*** Bug 373442 has been marked as a duplicate of this bug. ***
Comment 11 Daniel Vrátil 2017-01-06 22:06:55 UTC
*** Bug 373989 has been marked as a duplicate of this bug. ***
Comment 12 Patrizio Bekerle 2017-01-10 05:42:22 UTC
After I was hit by https://bugs.kde.org/show_bug.cgi?id=373782 and could "fix" that with the sql_mode change I also got 100% CPU for these agents on KDE neon User Edition 5.8:

- Notes Agent
- Migration Agent
- Archive Mail Agent
- Mail Dispatcher Agent

Removing the corresponding /home/user/.config/akonadi/agent_config_akonadi_*_agent_changes.dat files help for me too. The 4x 100% CPU symptom is gone and mails are sent again.
Comment 13 Cristiano Guadagnino 2017-01-20 08:10:14 UTC
I had the same problem as Patrizio, and using the workaround by Tomasz (comment 4) fixed it completely on my Tumbleweed.

Cris
Comment 14 Franco Pellegrini 2019-06-05 14:49:11 UTC
I was bitten by this bug too. The problematic file was agent_config_akonadi_imap_resource_0_changes.dat

After applying the suggested workaround (stop akonadi, rename the file, start akonadi), the issue went away.

this is on 

Akonadi 4:19.04.1-0xneon+18.04+bionic+build25

Operating System: KDE neon 5.15
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.0
Kernel Version: 4.15.0-50-generic