Re: [ANNOUNCE] mutt with notmuch support
[notmuch-archives.git] / 84 / 893a575fee279c53043e102f8a4c27615543c3
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 88D7E429E2A\r
6         for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 12:48:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.01\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.01 tagged_above=-999 required=5\r
12         tests=[T_MIME_NO_TEXT=0.01] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ZQqj4hYbjlUB for <notmuch@notmuchmail.org>;\r
16         Tue, 28 Jun 2011 12:48:40 -0700 (PDT)\r
17 Received: from arlo.cworth.org (arlo.cworth.org [50.43.72.2])\r
18         by olra.theworths.org (Postfix) with ESMTP id D17B7429E25\r
19         for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 12:48:39 -0700 (PDT)\r
20 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
21         by arlo.cworth.org (Postfix) with ESMTP id AB2AF29A820;\r
22         Tue, 28 Jun 2011 12:48:38 -0700 (PDT)\r
23 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
24         id 9D8112541A8; Tue, 28 Jun 2011 12:48:38 -0700 (PDT)\r
25 From: Carl Worth <cworth@cworth.org>\r
26 To: Mark Anderson <ma.skies@gmail.com>, Pieter Praet <pieter@praet.org>,\r
27         Robin Green <greenrd@greenrd.org>, notmuch@notmuchmail.org\r
28 Subject: Re: Race condition for '*' command\r
29 In-Reply-To: <87tyb9j1th.fsf@gmail.com>\r
30 References: <86d3i1d06r.fsf@dragonfly.greenrd.org>\r
31         <87sjqx31mp.fsf@servo.factory.finestructure.net>\r
32         <86aad5c6h2.fsf@dragonfly.greenrd.org>\r
33         <87fwmuxxgd.fsf@praet.org> <87tyb9j1th.fsf@gmail.com>\r
34 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1\r
35         (i486-pc-linux-gnu)\r
36 Date: Tue, 28 Jun 2011 12:48:26 -0700\r
37 Message-ID: <8739itagad.fsf@yoom.home.cworth.org>\r
38 MIME-Version: 1.0\r
39 Content-Type: multipart/signed; boundary="=-=-=";\r
40         micalg=pgp-sha1; protocol="application/pgp-signature"\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Tue, 28 Jun 2011 19:48:40 -0000\r
54 \r
55 --=-=-=\r
56 Content-Transfer-Encoding: quoted-printable\r
57 \r
58 On Tue, 28 Jun 2011 11:36:10 -0600, Mark Anderson <ma.skies@gmail.com> wrot=\r
59 e:\r
60 > On Tue, 28 Jun 2011 08:49:06 +0200, Pieter Praet <pieter@praet.org> wrote:\r
61 > > On Sun, 26 Jun 2011 10:00:41 +0100, Robin Green <greenrd@greenrd.org> w=\r
62 rote:\r
63 > > > On Sat, 25 Jun 2011 16:57:50 -0700, Jameson Graef Rollins <jrollins@f=\r
64 inestructure.net> wrote:\r
65 > > > > On Sat, 25 Jun 2011 23:18:52 +0100, Robin Green <greenrd@greenrd.or=\r
66 g> wrote:\r
67 > > > > > A race condition in the '*' command was noted when it was first\r
68 > > > > > proposed. It looks to me like it still exists - has anything been=\r
69  done\r
70 > > > > > about it?\r
71 \r
72 Not much. I did add this note to notmuch/TODO at the time:\r
73 \r
74         Fix '*' to work by simply calling '+' or '-' on a region\r
75         consisting of the entire buffer\r
76 \r
77 > > Could be solved by doing it with `notmuch-search', `mark-whole-buffer'\r
78 > > and `notmuch-search-{add,remove}-tag-region' instead, but I'm sure\r
79 > > there's a better way (of which I'm as of yet unaware).\r
80 \r
81 That's a more concrete description of the same idea.\r
82 \r
83 I did some experiments at one point and determined that doing this would\r
84 make '*' far too painful to be usable with large search-result buffers,\r
85 (which is precisely when I am most likely to use it).\r
86 \r
87 But even if we were willing to accept the performance penalty, (or if we\r
88 fixed notmuch-search-*-tag-region to accumulate the thread IDs and make\r
89 a single invocation of notmuch to avoid the performance penalty). Even\r
90 then, there would still be race conditions here, (though more subtle\r
91 than the current race).\r
92 \r
93 At that point we would only be acting on threads that matched the\r
94 original search, but we could be acting on more messages than were\r
95 originally presented to the user.\r
96 \r
97 For example, a thread might have been displayed as having only one post,\r
98 but the "* -inbox" operation would remove the inbox tag from any replies\r
99 received in the interim.\r
100 \r
101 I'd love to find some clean solutions here, as I would love notmuch to\r
102 offer an interface that is free of these race conditions, (which are\r
103 scary since they can prevent a user from seeing some mail).\r
104 \r
105 Personally, I'm avoiding all races right now by only running "notmuch\r
106 new" manually, (and not otherwise interacting with notmuch while\r
107 "notmuch new" is running). This does avoid the races, but is fairly\r
108 awkward, (I have to manually run this (or use the annoyingly blocking\r
109 'G'[*] binding), so I would prefer the ability to have new mail\r
110 incorporated automatically as it arrives.\r
111 \r
112 Independent of this particular race condition, having something like\r
113 fetchmail automatically invoke "notmuch new" also has the potential to\r
114 break your mail client with Xapian Database-modified exceptions.\r
115 \r
116 So we do need some more direct support for this mode of operation.\r
117 \r
118 In the meantime, I've at least updated the TODO note a bit:\r
119 \r
120         Fix '*' to work by simply calling '+' or '-' on a region\r
121         consisting of the entire buffer, (this would avoid one race\r
122         condition---while still leaving other race conditions---but\r
123         could also potentially make '*' a very expensive operation).\r
124 \r
125 =2DCarl\r
126 \r
127 [*] notmuch-search-poll-and-refresh-view\r
128 \r
129 =2D-=20\r
130 carl.d.worth@intel.com\r
131 \r
132 --=-=-=\r
133 Content-Type: application/pgp-signature\r
134 \r
135 -----BEGIN PGP SIGNATURE-----\r
136 Version: GnuPG v1.4.11 (GNU/Linux)\r
137 \r
138 iEYEARECAAYFAk4KMAoACgkQ6JDdNq8qSWjIwACffAcWjBu1RNxBmvMUz9iyPMX2\r
139 M9QAoJ0FRDH1SGqm4cV+IP6irRze/s0n\r
140 =BO27\r
141 -----END PGP SIGNATURE-----\r
142 --=-=-=--\r