Bug 334209 - synchronizes folder contents during runtime needlessly when switching between different folders
Summary: synchronizes folder contents during runtime needlessly when switching between...
Status: REOPENED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: 5.14.1
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-02 08:58 UTC by Martin Steigerwald
Modified: 2021-04-20 13:54 UTC (History)
2 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 Martin Steigerwald 2014-05-02 08:58:07 UTC
I think Akonadi synchronrizes folders with filesystem content needlessly on switching between different folders. In combination with bug 334206 it blocks out KMail for minutes then.

Reproducible: Always

Steps to Reproduce:
1. Have several large folders.
2. Switch between them until Akonadi blocks KMail and KMail doesn´t respond to clicks anymore.
Actual Results:  
1. KMail doesn´t respond to clicks anymore for minutes.
2. akonadi_maildir_resource is using 100% of one Sandybridge core for minutes.
3. strace reveals that akonadi_maildir_resource is stat()ing every single file in the folder it synchronrizes.

[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R234.merkaba", {st_mode=S_IFREG|0644, st_size=4079, ...}) = 0
[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R322.merkaba", {st_mode=S_IFREG|0644, st_size=8056, ...}) = 0
[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R342.merkaba", {st_mode=S_IFREG|0644, st_size=2771, ...}) = 0
[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R608.merkaba", {st_mode=S_IFREG|0644, st_size=4492, ...}) = 0
[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R665.merkaba", {st_mode=S_IFREG|0644, st_size=13036, ...}) = 0
[pid  4137] stat("/home/martin/.local/share/local-mail/.Lichtvoll.directory/.Linux.directory/kernel-ml/new/1376733031.R738.merkaba", ^C{st_mode=S_IFREG|0644, st_size=6870, ...}) = 0

This doens´t happen all of the time tough. Sometimes I am able to click around folders without having this issue. I am able to reproduce this directly after restarting Akonadi. There synchronizing folders for *one* time actually makes sense as a folder may have been changed meanwhile by another process. An option to disable this if user knows that no one except Akonadi will be accessing this maildir would be nice tough.

I think it doesn´t happen only after restart tough. Usually I have Akonadi running for days as I hibernate and resume my laptop. And I see this behaviour each day. IMHO there does not need any folder with filesystem contents synchronisation during runtime of Akonadi as maildir resource uses inotify to watch folders.

Expected Results:  
There will be no synchronisation with filesystem contents during runtime of Akonadi as Akonadi maildir resource uses inotify to watch the folders for changes.

ThinkPad T520 with Sandybridge Dual core and Dual SSD BTRFS RAID 1. There is *no* I/O bottleneck. Maildir resource just hogs a core for minutes.

Akonadi is git n1d1969c65c10c9d3f054f6dafb0f5a2a97d48281
Comment 1 Martin Steigerwald 2014-05-02 11:07:53 UTC
It also happens after downloading and filtering mails:

Bug 334216 - synchronizes folder with filesystem after downloading and filtering mails needlessly
Comment 2 Martin Steigerwald 2016-08-27 11:13:47 UTC
I do not see this anymore on KMail/Akonadi 16.04 during switching folders. Thus closed.
Comment 3 Martin Steigerwald 2020-06-09 09:23:31 UTC
This is again happening. Maybe it never stopped with 16.04, but after the serious performance regression between Akonadi 19.08 and Akonadi 5.14.1 (20.04)¹ it is again much more noticable.

[1] Bug 422336 - kmail: the access and reading of the received messages is often very slow