From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 51FD141ED93 for ; Fri, 1 Jul 2011 07:55:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id avFKwAzyFr0w for ; Fri, 1 Jul 2011 07:55:14 -0700 (PDT) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 8BD0441ED86 for ; Fri, 1 Jul 2011 07:55:14 -0700 (PDT) Received: by qyk9 with SMTP id 9so2189003qyk.5 for ; Fri, 01 Jul 2011 07:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=UJMkV0UwUTQf9t7I5b1BQ+dVypEj5dkma/xNfUHKiCo=; b=DHEqfJB8LXqBpW9Y8vmwQ8YxhLwBZpxwkyHfx4dPywa/sWM90cbvKewPBO/ycEpXTV YoFpLLhRPBlVli1gVJZECf2gxmzoeIzdQp8eT68c+swA0cvXk0lrNGtzGsQFAfNTnVFw W6NSIljdkz/XYMhnj/9E3gMyR5Gbjduw1Edkc= MIME-Version: 1.0 Received: by 10.229.106.32 with SMTP id v32mr2616575qco.77.1309532113634; Fri, 01 Jul 2011 07:55:13 -0700 (PDT) Sender: amdragon@gmail.com Received: by 10.229.249.193 with HTTP; Fri, 1 Jul 2011 07:55:13 -0700 (PDT) In-Reply-To: <87r56brtxt.fsf@praet.org> References: <8739itagad.fsf@yoom.home.cworth.org> <1309450108-2793-1-git-send-email-pieter@praet.org> <1309450108-2793-2-git-send-email-pieter@praet.org> <87r56brtxt.fsf@praet.org> Date: Fri, 1 Jul 2011 10:55:13 -0400 X-Google-Sender-Auth: Ivdxn_e_u2WGmM6XswSPWWGP7ok Message-ID: Subject: Re: [PATCH 2/2] [RFC] possible solution for "Race condition for '*' command" From: Austin Clements To: Pieter Praet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2011 14:55:15 -0000 On Thu, Jun 30, 2011 at 3:38 PM, Pieter Praet wrote: > Ok, even though my very first reply [1] may have created the impression > that I understood the issue, I clearly didn't... > > The test [2] needs a more applicable commit message, and the subsequent > patch [3] points more or less in the right direction, but the Message-Id > list should be local to the *search buffer* rather than to the > `notmuch-search-operate-all' function. > > `notmuch-search' could: > =A0- run "notmuch-command search" with the "--output=3Dmessages" option > =A0 =A0instead of a plain search, > =A0- maintain a buffer-local var with a list of returned Message-Id's, > =A0- ...and populate the buffer based on that list. > > As such we'd have -for each individual search buffer- a canonical list > of Message-Id's (i.e. messages which actually *match* the query AND are > currently visible in the search buffer), to be used by > `notmuch-search-operate-all' et al. > > > Peace > > -- > Pieter > > [1] id:"87fwmuxxgd.fsf@praet.org" > [2] id:"1309450108-2793-2-git-send-email-pieter@praet.org" > [3] id:"1309450108-2793-1-git-send-email-pieter@praet.org" Ideally, this wouldn't be per-buffer, but per *line*. This race equally affects adding and removing tags from individual results, since that's done using a thread: query, whose results could have changed since the original search. This almost certainly requires support from the notmuch core. The good news is that the library already provides this information, so there will be virtually no performance hit for outputting it.