Bug 4602 - Slow folder opening due to cache rebuild
Summary: Slow folder opening due to cache rebuild
Status: RESOLVED INVALID
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: 3.17.8
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
: 3272 4228 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-04 23:42 UTC by J
Modified: 2022-06-06 22:53 UTC (History)
1 user (show)

See Also:


Attachments

Description J 2022-06-04 23:42:32 UTC
Hi.

I'm using claws-mail with IMAP.

While most folders open instantly, some folders take ages to open: INBOX, Spam and some random subfolder of another folder seem to be the only impacted ones.

When in debug mode, I get those in the logs:

imap.c:1584:trying to fetch cached /home/jerome/.claws-mail/imapcache/domain/address/Folder/5357
imap.c:1594:message 5357 has been already cached.
file-utils.c:58:TIMING safe_fclose : 0s068ms
procheader.c:197:generic_get_one_field: empty line

I have no idea why it only happens with those three folders.

This has been an issue for quite a while (years, I believe, at least for INBOX folder).

I just managed to solve the case of Spam and the other folder by renaming the folder and creating a new one with the same name. The new one is not affected, even after I copy the messages from the old one to the new one.

Unfortunately, I can't rename INBOX.

I tried to empty INBOX by moving messages into a temporary folder (using the UI). The tmp folder would open instantly. I then closed claws-mail and removed the dotfiles (.claws_cache and .claws_mark) in INBOX but as soon as I put the messages back from tmp, the issue reappears.

I also tried to close claws-mail, delete INBOX folder from imapcache, then launch claws-mail. claws-mail recreated INBOX folder and redownloaded the messages from the server and the issue still persists.

Issues that might be related:

https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3272
https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4243 (less likely)

I don't know what else I could do to track the issue but the log above seems like a nice hint already.

Needless to say, this is a bit of an annoyance, especially considering the INBOX folder is the one affected.

Anything I could try to solve or workaround this?

Thanks.
Comment 1 J 2022-06-04 23:46:18 UTC
Sorry, I just realized I already filed another bug reported a while back

https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4228

BTW I removed all plugins.
Comment 2 J 2022-06-04 23:55:22 UTC
In Preferences -> Other -> Miscellaneous -> Metadata handling, I just checked "Faster".

I still get the log lines shown above for INBOX and not for other folders but it is so much faster that it is viable. About a second to load INBOX with 200 messages, still noticeable but not a real issue anymore.
Comment 3 Paul 2022-06-05 10:48:31 UTC
*** Bug 4228 has been marked as a duplicate of this bug. ***
Comment 4 Paul 2022-06-05 10:50:01 UTC
Out of interest, what filesystem do you use?
Comment 5 Paul 2022-06-05 10:54:02 UTC
*** Bug 3272 has been marked as a duplicate of this bug. ***
Comment 6 J 2022-06-06 22:53:42 UTC
I use ext4 for both / and /home (where the email files are stored).

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/md0p2 during installation
UUID=xxx /               ext4    errors=remount-ro 0       1
# /home was on /dev/md0p3 during installation
UUID=xxx /home           ext4    defaults        0       2


While I'm happy I can now open my inbox pretty fast, I'd call this a workaround.

It could still be noticeably slow if the inbox contained more messages.

Also, there is something going on that I don't understand. Why the "trying to fetch cached" messages in the logs? How come it only happened on 3 folders and I managed to remove them by just recreating the folders?

I'm wondering if removing the whole account from my machine and creating a new one would "solve" the INBOX case.

Note You need to log in before you can comment on or make changes to this bug.