[PATCH 00/11] Fix search tagging races

Austin Clements amdragon at MIT.EDU
Wed Oct 9 09:11:21 PDT 2013


Quoth Mark Walters on Oct 09 at  8:43 am:
> 
> On Mon, 07 Oct 2013, Austin Clements <amdragon at MIT.EDU> wrote:
> > I was hacking on undo support for notmuch-emacs and sort of
> > accidentally wrote this instead.  This series fixes a set of
> > well-known races where tagging from search-mode unexpectedly affects
> > messages that arrived after the search was performed (and hence the
> > user doesn't know they're tagging them).  We've attacked this a few
> > times before, but have always run up against something that was
> > missing.  It turns out the pieces are finally all in place.
> >
> > The first five patches just clean various things up in preparation.
> > Patches 6 and 7 add support for tagging large queries, which would
> > otherwise become a problem when later patches start using explicit
> > message ID-based queries for tagging.  The remaining four patches
> > actually fix the search tagging races using explicit message ID-based
> > queries.
> >
> > It's a fairly long series, but none of the patches are very big.
> 
> One more thought on this: what should "*+tag" do if the search buffer is
> still filling?
> 
> As it stands this is a substantial change: previously you could
> look at the first few threads to make sure the query was doing what you
> expected and then tag all the matching threads. Now you would have to
> wait for the buffer to fill and there is not even a clear indication to
> the user of when that happens (except scroll to the bottom and see if it
> says "End of search results.")

That's a very interesting point.

Arguably, this is one situation where it's almost certainly safe to
use the original query: if the search hasn't finished yet, almost
certainly none of the threads have changed.  So, that's one
possibility.

Another possibility would be to simply echo "Waiting for all search
results...  (Press C-g to cancel)" and wait until the search is done.

> Best wishes
> 
> Mark


More information about the notmuch mailing list