[PATCH 3/8] packaging: fedora: trivial cleanups
[notmuch-archives.git] / 5b / baa6d94e9f95ac237388485ff6574714dac247
1 Return-Path: <amdragon@gmail.com>\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 913C7431FB6\r
6         for <notmuch@notmuchmail.org>; Fri, 28 Jan 2011 10:17:19 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
13         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id s-28PaUfxJA7 for <notmuch@notmuchmail.org>;\r
17         Fri, 28 Jan 2011 10:17:19 -0800 (PST)\r
18 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
19         [209.85.216.181]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id D122D431FB5\r
22         for <notmuch@notmuchmail.org>; Fri, 28 Jan 2011 10:17:18 -0800 (PST)\r
23 Received: by qyk12 with SMTP id 12so3940826qyk.5\r
24         for <notmuch@notmuchmail.org>; Fri, 28 Jan 2011 10:17:18 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:mime-version:sender:in-reply-to:references:date\r
27         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
28         :content-transfer-encoding;\r
29         bh=9tgRmcdPcKCrEYXfKeZcIP8ejrPcH0HFJrRMmObQh94=;\r
30         b=n+aa8+0Vt+acWLPRRQkVUQuT7B7TqhPj+1fRUMTRFhzfkh7ulBcwZJQjrcNt51xw5M\r
31         C+/Ndraw6i9hnlD+X+xehTpOS0IbJVBaIohvOSLRdmFEHF1wtjeWV+YAuMYT3eesIvMB\r
32         OnBNbR4bgbOhI7kCb3v0z73P4guzDKtygzp5s=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
34         h=mime-version:sender:in-reply-to:references:date\r
35         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
36         :content-transfer-encoding;\r
37         b=R09gMMvGatRWAXdZAG1BviYrq01YsSSfgepdiEFJJlqI1kBZP80nusKrL8SXFOms9I\r
38         M6DbR3T3quhoqU6hXCTl4S3hcr23UvYyIpoZJ5traEIksBb/lJ9fY8xDBBvWS+QnvjHR\r
39         Dd9Wm1N9gk4TBBG4Za+a+ATgU0cOuID4KMohA=\r
40 MIME-Version: 1.0\r
41 Received: by 10.229.220.81 with SMTP id hx17mr1166490qcb.116.1296238638065;\r
42         Fri, 28 Jan 2011 10:17:18 -0800 (PST)\r
43 Sender: amdragon@gmail.com\r
44 Received: by 10.229.97.143 with HTTP; Fri, 28 Jan 2011 10:17:18 -0800 (PST)\r
45 In-Reply-To: <AANLkTim9FEEn6bpeAb1oHVScs4RGbK-UrFY+52ZKWv4E@mail.gmail.com>\r
46 References: <87fwsetdin.fsf@kepler.schwinge.homeip.net>\r
47         <8762taxk9y.fsf@algae.riseup.net>\r
48         <87vd1a84qj.fsf@servo.finestructure.net>\r
49         <AANLkTi=pPgcPXUN_XTXa0gAkbTR_OF4XxCP-d4-Be2pt@mail.gmail.com>\r
50         <87fwsdobpy.fsf@yoom.home.cworth.org>\r
51         <877hdps6og.fsf@kepler.schwinge.homeip.net>\r
52         <1296228975-ner-3626@everglades>\r
53         <AANLkTim9FEEn6bpeAb1oHVScs4RGbK-UrFY+52ZKWv4E@mail.gmail.com>\r
54 Date: Fri, 28 Jan 2011 13:17:18 -0500\r
55 X-Google-Sender-Auth: dJSapOE3E4wmvF6-fS9DBwk7bLI\r
56 Message-ID: <AANLkTi=jiVNAUsrjFd-Sw6FEFywMuUsVYetVo=R8fPDW@mail.gmail.com>\r
57 Subject: Re: notmuch's idea of concurrency / failing an invocation\r
58 From: Austin Clements <amdragon@mit.edu>\r
59 To: Mike Kelly <pioto@pioto.org>\r
60 Content-Type: text/plain; charset=ISO-8859-1\r
61 Content-Transfer-Encoding: quoted-printable\r
62 Cc: notmuch@notmuchmail.org\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Fri, 28 Jan 2011 18:17:19 -0000\r
76 \r
77 Actually, this is trivial to play with.  Here's a stop-gap wrapper\r
78 script for people having trouble with Xapian locking,\r
79 \r
80 #!/bin/bash\r
81 \r
82 NOTMUCH_BIN=3D"/path/to/notmuch"\r
83 MAIL_DIR=3D"/path/to/mailroot"\r
84 \r
85 (\r
86     case "$1" in\r
87         setup|help)\r
88             ;;\r
89         search|show|count|reply|dump|search-tags|part)\r
90             flock -s 200;;\r
91         *)\r
92             flock -x 200;;\r
93     esac\r
94     "$NOTMUCH_BIN" "$@" 200>&-\r
95 ) 200>"$MAIL_DIR"/.notmuch/lock\r
96 \r
97 On Fri, Jan 28, 2011 at 11:57 AM, Austin Clements <amdragon@mit.edu> wrote:\r
98 >\r
99 > On Fri, Jan 28, 2011 at 10:36 AM, Mike Kelly <pioto@pioto.org> wrote:\r
100 >>\r
101 >> On Fri, 28 Jan 2011 10:45:19 +0100, Thomas Schwinge <thomas@schwinge.nam=\r
102 e> wrote:\r
103 >> > > It would definitely be nice to avoid the complexity inherent in havi=\r
104 ng a\r
105 >> > > daemon, but how do you imagine "queue on a lock" to work? We don't h=\r
106 ave\r
107 >> > > anything like that in place now.\r
108 >> >\r
109 >> > I suppose what he means is trying to get the lock, and if that fails w=\r
110 ait\r
111 >> > a bit / wait until it is available again.\r
112 >> >\r
113 >> > Actually, as a next step, wouldn't it also be possible to add some\r
114 >> > heuristic to avoid ``notmuch new'' (being a low-priority task) blockin=\r
115 g\r
116 >> > some interactive user (UI; high-priority task)? =A0But we can pursue s=\r
117 uch\r
118 >> > schemes as soon as the basic infrastructure is in place.\r
119 >>\r
120 >> Couldn't we pretty much get the desired behavior by using flock(2)?\r
121 >> Basically, take out a LOCK_EX when we need to write, and a LOCK_SH when\r
122 >> we only need to read. Using the blocking form, things should pretty much\r
123 >> just queue up and take their turn, right?\r
124 >>\r
125 >> I'm not familiar with Xapian, but if it doesn't give us something we\r
126 >> could use this sort of locking on, couldn't we just add some\r
127 >> /path/to/mail/.notmuch.lock file that we open to hold a lock on?\r
128 >\r
129 > Yes, exactly. =A0All of this. =A0Unfortunately, Xapian doesn't expose the=\r
130  ability to block on the lock (see the fcntl call in backends/flint_lock.cc=\r
131 , which is hard-coded to the non-blocking F_SETLK instead of F_SETLKW), so =\r
132 we'd either need a new Xapian option, or we would just have to wrap our own=\r
133  flock/fcntl lock around things as you suggest.\r