Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 95 / 2d6d668b91dfe5f90592ea69a3a9e7d8c76d65
1 Return-Path: <aclements@csail.mit.edu>\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 2CA8F431FBC\r
6         for <notmuch@notmuchmail.org>; Thu,  2 Oct 2014 12:18:54 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 Mw4ox0DrvKFq for <notmuch@notmuchmail.org>;\r
16         Thu,  2 Oct 2014 12:18:48 -0700 (PDT)\r
17 Received: from outgoing.csail.mit.edu (outgoing.csail.mit.edu [128.30.2.149])\r
18         by olra.theworths.org (Postfix) with ESMTP id 00ECA431FB6\r
19         for <notmuch@notmuchmail.org>; Thu,  2 Oct 2014 12:18:47 -0700 (PDT)\r
20 Received: from [104.131.20.129] (helo=awakeningjr)\r
21         by outgoing.csail.mit.edu with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)\r
22         (Exim 4.72) (envelope-from <aclements@csail.mit.edu>)\r
23         id 1XZltk-0007rB-QU; Thu, 02 Oct 2014 15:18:44 -0400\r
24 Received: from amthrax by awakeningjr with local (Exim 4.84)\r
25         (envelope-from <aclements@csail.mit.edu>)\r
26         id 1XZltk-0005Xo-8v; Thu, 02 Oct 2014 15:18:44 -0400\r
27 From: Austin Clements <aclements@csail.mit.edu>\r
28 To: "W. Trevor King" <wking@tremily.us>\r
29 Subject: Re: [PATCH v3] lib: Simplify close and codify aborting atomic section\r
30 In-Reply-To: <20140924213910.GF20130@odin.tremily.us>\r
31 References: <20140924212839.GE20130@odin.tremily.us>\r
32         <1411594370-9794-1-git-send-email-aclements@csail.mit.edu>\r
33         <20140924213910.GF20130@odin.tremily.us>\r
34 User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/24.3.1\r
35         (x86_64-pc-linux-gnu)\r
36 Date: Thu, 02 Oct 2014 15:18:44 -0400\r
37 Message-ID: <87mw9ee0vf.fsf@csail.mit.edu>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\r
40 Cc: notmuch@notmuchmail.org\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: Thu, 02 Oct 2014 19:18:54 -0000\r
54 \r
55 On Wed, 24 Sep 2014, "W. Trevor King" <wking@tremily.us> wrote:\r
56 > On Wed, Sep 24, 2014 at 05:32:50PM -0400, Austin Clements wrote:\r
57 >> + * If the caller is currently in an atomic section (there was a\r
58 >> + * notmuch_database_begin_atomic without a matching\r
59 >> + * notmuch_database_end_atomic), this will abort the atomic section,\r
60 >> + * discarding any modifications made in the atomic section.  All\r
61 >> + * changes up to this will be committed.\r
62 >\r
63 > I still think Xapian's wording is more readable [1]:\r
64 >\r
65 >   For a WritableDatabase, if a transaction is active it will be\r
66 >   aborted, while if no transaction is active commit() will be\r
67 >   implicitly called.\r
68 >\r
69 > How about:\r
70 >\r
71 >   For a writable database, if a transaction is active (there was a\r
72 >   notmuch_database_begin_atomic without a matching\r
73 >   notmuch_database_end_atomic) it will be aborted, while if no\r
74 >   transaction is active any pending changes will be committed.\r
75 \r
76 What is a "pending change" from the perspective of the notmuch API?\r
77 This is tricky because basically nothing in the library talks about\r
78 durability (partly because the notmuch API provides almost no control\r
79 over it).  Likewise, the API doesn't expose the notion of a transaction\r
80 (since that generally implies ACID), but only atomic sections.\r
81 \r
82 I actually find the Xapian wording rather confusing.  Neither Xapian's\r
83 documentation nor your suggested comment say what happens when there is\r
84 *both* an outstanding transaction and pending changes.  In fact, teasing\r
85 this out made me realize that Xapian might in fact discard committed\r
86 (but unflushed) changes if you close the database with an outstanding\r
87 transaction.  But we definitely do want to flush these transactions\r
88 (especially since *all* of our atomic sections are "unflushed\r
89 transactions").  In v4 I've added some code to make sure this happens,\r
90 but because of the vagueness of the documentation I have no idea if it's\r
91 necessary.\r
92 \r
93 > Cheers,\r
94 > Trevor\r
95 >\r
96 > [1]: http://xapian.org/docs/apidoc/html/classXapian_1_1Database.html#a59f5f8b137723dcaaabdbdccbc0cf1eb\r
97 >\r
98 > -- \r
99 > This email may be signed or encrypted with GnuPG (http://www.gnupg.org).\r
100 > For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\r