<<< Date Index >>>     <<< Thread Index >>>

Re: mutt/2870: color index foo foo ~h pattern causes many fileops



The following reply was made to PR mutt/2870; it has been noted by GNATS.

From: Michael Elkins <me@xxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc: 
Subject: Re: mutt/2870: color index foo foo ~h pattern causes many fileops
        on resync only
Date: Thu, 29 Mar 2007 18:44:04 -0700

 On Thu, Mar 29, 2007 at 05:43:53PM +0200, marc_soft@xxxxxxxxxxx wrote:
 > The unanswered questions are:
 > 1) why can mutt use the header cache to run the ~h rules when the folder
 >    is opened, but not when it's resynced
 > 
 > 2) Why does adding a message to a folder cause mutt to ignore its entire
 >    cache and rebuild a brand new one at resync time, scanning all messages
 >    multiple times, when at folder open time, mutt looks smart enough to use
 >    the cache for already cached messages, and only open/index/scan whatever
 >    few messages that weren't in the cache already?
 
 Unfortunately, it is possible that a message in the cur/ subdirectory is
 modified in another Mutt which would be undetectable without a full
 rescan.  Operations which rewrite the message header such as
 edit-message or {break,join}-threads would cause the cache to be bad.
 You can't rely on the times from stat() because Mutt uses utime() to
 restore the times after an edit.
 
 Mutt assumes the cache is valid when the mailbox is open, so it only
 scans for messaages not already in the cache.
 
 > Fixes would be:
 > 1) mutt should never open a stat the same file 4 times in a row
 
 I am not sure why that would happen, but I agree.
 
 > 2) mutt resync code looks very suboptimal compared to folder open code.
 >    If it were to only parse new messages in the folder (messages not in
 >    the cache), it would effectively fix this problem.
 
 This won't work, as described above.
 
 me