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

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

Date: Wed, 29 Jun 2011 06:47:37 -0700

To: Austin Clements, notmuch@notmuchmail.org

Cc: amdragon@mit.edu

From: Carl Worth


On Wed, 29 Jun 2011 03:10:54 -0400, Austin Clements <amdragon@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@intel.com
part-000.sig (application/pgp-signature)

Thread: