[PATCH 1/2] new: Don't update DB mtime if FS mtime equals wall-clock time.

Carl Worth cworth at cworth.org
Wed Jun 29 06:47:37 PDT 2011


On Wed, 29 Jun 2011 03:10:54 -0400, Austin Clements <amdragon at MIT.EDU> wrote:
> This fixes a race where multiple message deliveries in the same second
> with an intervening notmuch new could result in messages being ignored
> by notmuch (at least, until a later delivery forced a rescan).

Thanks for the fix, Austin!

> +     * XXX Bug workaround: If this is a new directory, we *must*
> +     * update the mtime; otherwise the next run will see the 0 mtime
> +     * and think this is still a new directory containing no files or
> +     * subdirs (which is unsound in general).  If fs_mtime ==
> +     * stat_time, we set the database mtime to a bogus (but non-zero!)
> +     * value to force a rescan.

I like to reserve "XXX" as an indication that some further work is
necessary.

That doesn't seem to be the case here, (instead, you seem to have
thought this issue out quite fully).

Other than that, I'm quite happy with the patch.

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110629/6bc21b68/attachment.pgp>


More information about the notmuch mailing list