Bug 334216

Summary: synchronizes folder with filesystem after downloading and filtering mails needlessly
Product: [Frameworks and Libraries] Akonadi Reporter: Martin Steigerwald <Martin>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal    
Priority: NOR    
Version: 5.14.1   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Martin Steigerwald 2014-05-02 11:07:15 UTC
After I download and filter mails often Akonadi synchronizes folder with filesystem needlessly.

Reproducible: Sometimes

Steps to Reproduce:
1. Have large folders.
2. Have some mailing list subscribed
3. Have some filter rules
4. Wait a while
5. Download and filter mails.

I do downloading and filtering separately as to weed out spam before I do the filtering (due to Bug #319226 - produces 1-byte-sized on processing crm114 spam filter rules).
Actual Results:  
Akonadi maildir resource hogs one core for minutes on synchronizing folder with filesystem contents. I didn´t verify it with strace again, but I am pretty sure it does the same as in bug #334209. Stating each file in the maildir folder.

Expected Results:  
No synchronisation with filesystem, cause:

1) Akonadi uses Inotify to watch for folder changes.

2) Akonadi mailfilter moves mails with Akonadi. So Akonadi is supposed to know where these mails are now.

Akonadi git 159bfbdf8667bb01b1f4c85ea144ca128ccb3195.

ThinkPad T520, Sandybridge, Dual SSD BTRFS RAID 1 allowing concurrent accesses to two SATA-300 connected SSDs.
Comment 1 Martin Steigerwald 2016-08-27 11:16:06 UTC
This still happens with KMail/Akonadi 16.04. Its not nearly as annoying as Akonadi maildir resource is much faster now on synchronisation folders. Its still synchronizing although it should know which mails mailfilter agent just moved to a different folder, instead of asking the filesystem about it.
Comment 2 Martin Steigerwald 2017-05-06 09:09:50 UTC
Dan hinted me at disabling automatic synchronization for the folders in question. So I checked this setting: I had it disabled for Maildir resource main folder and all subfolders I checked are set to inherit that setting.

So it seems at least after first start of Akonadi… or in some interval I do not yet have an exact clue about filtering a mail into a folder triggers a resynchronization despite disabled automatic synchronization.
Comment 3 Martin Steigerwald 2020-06-05 16:09:15 UTC
This still happens with Akonadi 5.14.1 (20.04)