Bug 421114 - Excessive CPU usage and logging (ItemRetrievalJob) in KMail / Akonadi when mail draft or template does not include any text / has empty body
Summary: Excessive CPU usage and logging (ItemRetrievalJob) in KMail / Akonadi when ma...
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: GIT (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-06 17:32 UTC by null
Modified: 2020-05-06 17:32 UTC (History)
0 users

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 null 2020-05-06 17:32:31 UTC
When composing a message and saving it as a draft without having written any text yet, akonadiserver will become very busy, resulting in a sluggish overall system. Note that this also affects saving as a template, where having an empty text area could be considered a common use case.

Symptoms include the log filling up with
> org.kde.pim.akonadiserver: ItemRetrievalJob for request 646 finished
(with the counter incrementing by one each time) even when KMail is idle/unfocussed.

There are two cases for the logging frequency:
- several messages a second if the mail is selected, going along with very high CPU usage (kmail, mysqld and akonadiserver in particular)
- a message every 5 seconds if a different (non-broken) mail is selected
The issue persists even after restarting KMail and Akonadi.

Steps to reproduce:
- start KMail with a clean KMail/Akonadi config
- no need to create any account besides "Local Folders"
- create new mail, leave all fields empty, save as draft
- select mail, notice high CPU usage and excessive logging
- edit mail by adding text in the message editor, save as draft again
- notice CPU becoming idle again, no more logging

Affected versions:
- can be reproduced with KF5 and KDE PIM from git master as of today (5.14.40) and Qt 5.14.1
- KMail 5.9.2 is affected too
- KMail 5.5.2 is _not_ affected

Possibly related: Bug 398407