On 2018-06-11 10:30:27 +0200, Vincent Lefevre wrote:
> I think that there is a race condition with the inotify code: the
> inotify event is obtained while the mailbox hasn't been completely
> updated, so that one doesn't get the latest messages. What might
> happen is that the directory is being updated during the readdir.

This is the problem. Mutt receives the inotify event and does the
opendir before the files are actually added to the directory. Thus
these files are not visible by readdir. I assume that when the files
are added, other mtime updates occur on the FS side, but since Mutt
uses a 1-second resolution, the mtime value doesn't appear to change.

Switching to a nanosecond resolution would probably solve the problem,
but I suppose that's not portable. As I suggested, a workaround is to
force a rescan a few seconds after this scan.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to