Re: A systematic way of handling Xapian lock errors?
[notmuch-archives.git] / 18 / fa223e3a1e945d9bf64655cc8ef2503fe4403e
1 Return-Path: <eric@deptj.eu>\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 arlo.cworth.org (Postfix) with ESMTP id 7F1846DE103A\r
6  for <notmuch@notmuchmail.org>; Tue,  1 Mar 2016 10:35:38 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.092\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.092 tagged_above=-999 required=5 tests=[AWL=0.002, \r
12  DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001,\r
13  RCVD_IN_MSPIKE_H3=-0.01, \r
14  RCVD_IN_MSPIKE_WL=-0.01, T_DKIM_INVALID=0.01] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id lcNpAVgW1xPx for <notmuch@notmuchmail.org>;\r
18  Tue,  1 Mar 2016 10:35:35 -0800 (PST)\r
19 Received: from mx1.solardns.com (mx1.solardns.com [109.73.127.119])\r
20  by arlo.cworth.org (Postfix) with ESMTPS id 52F656DE00DF\r
21  for <notmuch@notmuchmail.org>; Tue,  1 Mar 2016 10:35:34 -0800 (PST)\r
22 Received: from [213.129.84.218] (helo=luna.solardns.com)\r
23  by mx1.solardns.com with esmtps (TLSv1.2:DHE-RSA-AES256-SHA:256)\r
24  (Exim 4.85) (envelope-from <eric@deptj.eu>) id 1aap8k-0007pL-W9\r
25  for notmuch@notmuchmail.org; Tue, 01 Mar 2016 18:35:30 +0000\r
26 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deptj.eu;\r
27  s=default; h=Date:Message-ID:References:In-Reply-To:To:Subject:From;\r
28  bh=cX/TxD4F1eJXciRcUZem+xKwjBFSallgNy2EO8+pES4=; b=Ax6UCrWm/r6nlYcrXtvd/xJWUK\r
29  nr02lLQORD0o2sRLK2sLewblP2lBCAI9h6I30AvYo2sC0HCRx3TPM6mbPwamWMW6khar9lKvxkH3D\r
30  zf02bnJjxCPc+AlUiEClUsTX9F5711Zmlz6t67oiK/BvwwhNE0mLrmM5PyKpbFDIg39Y=;\r
31 Received: from [2.12.196.83] (port=51853 helo=bruno.deptj.eu)\r
32  by luna.solardns.com with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256)\r
33  (Exim 4.86) (envelope-from <eric@deptj.eu>) id 1aap8k-000X9f-Ea\r
34  for notmuch@notmuchmail.org; Tue, 01 Mar 2016 18:35:22 +0000\r
35 Received: from eric by bruno.deptj.eu with local (Exim 4.84)\r
36  (envelope-from <eric@deptj.eu>) id 1aap8j-000315-Np\r
37  for notmuch@notmuchmail.org; Tue, 01 Mar 2016 19:35:21 +0100\r
38 From: Eric J <eric@deptj.eu>\r
39 Subject: Re: Tcl bindings for notmuch\r
40 To: notmuch@notmuchmail.org\r
41 In-Reply-To: <0379758d60f150aa79777a12361b036358b8d949-NM@bruno.deptj.eu>\r
42 References: <0379758d60f150aa79777a12361b036358b8d949-NM@bruno.deptj.eu>\r
43 Message-ID: <49bd0126ca982aba70990f1e1526aaac384b620e-NM@bruno.deptj.eu>\r
44 Date: Tue, 01 Mar 2016 19:34:40 +0100 (CET)\r
45 X-AuthUser: deptjeu\r
46 X-Filter-ID:\r
47  s0sct1PQhAABKnZB5plbIZxxbsbMXbbOVqDrOlLQDPCKLoLP9dSDpksiPa3sfcfQiw3bi2TEXpBy\r
48  KOgMDJLxZ2gLr13hkJnqYlE8dI2PqoFC/lGsrXcsS0xY0J18f6o7xB66CWvXcfKDfXjTU++u62Tf\r
49  3IaijxFCsl1Acjok/mtg3GKfo28I/znarUMoy/Q1ZuM7jUXIESohoO51xWmU8U0XxLGz4gGrl7np\r
50  YUMMsx7Zx6js8RMGZ+eyCM03IideZE/8G6RrW+hPYRmHOym9VEp4OmAp9SwcFw57ijAOXur1H/aA\r
51  warQpYDOYx/6JtUOKIpz/KyJk6xidDbrtJGeIvwS+mRNB2u5eXMTyiRDCl4blv/7/GYDGL6pBAPx\r
52  3RhxuHrpSpJU4PQlqFj9797wgsGhIeDBws4kvu4hgViYIJSOH7FelTFEA57OugCjQqJvq5XDlSi1\r
53  S/CAqp6x6giLUpAadaOpLL7vzAlHz9Vt0lJbH3q7FSJEAvmcpRDg+DcXMCx8qKfWo/2nfeswSb/v\r
54  XOidX4Ts4xdG+C13IyWeZaJClvAWyUAUCSYHhmge3quet8geXjZWRvaT/RbJ/nX/IFFm7SbdEzck\r
55  901Ob2Iq9tC/Vh1lis0iI/S1HLwoHXf0\r
56 X-Report-Abuse-To: spam@mx1.solardns.com\r
57 X-Filter-Fingerprint:\r
58  IFrWXGses7OKB5S5G8/dJdIz5bb8V0ykx8BnFBnunHBA3cTUQ1R++keuE7RDJ8Kg3RbMLUalw1oC\r
59  mj99/u+Poh38tEMU4IgC4sNz49qn3HHnhRv/ZJ3kEy8bfiAr+Fb/UpndEJ0YoaLytXXo8BMTaVt0\r
60  ARHRi6XGuAluI1udprGClI6bm+u9ssQgM5AHe3Zacv4uJct5wtJvPpZ2dlBHCwDSxr3Vz+LJ/RhM\r
61  2JZ0ECN5dnq47RWft7iCyM9+PbHelB4qP9S6mTzNwoPraFy6ieiDqMHb2a0eZvGOvr7RaxKWGCKO\r
62  us9nABr0Pk/4CplP\r
63 X-Originating-IP: 213.129.84.218\r
64 X-SpamExperts-Domain: out.solardns.com\r
65 X-SpamExperts-Username: 213.129.84.218\r
66 Authentication-Results: solardns.com;\r
67  auth=pass smtp.auth=213.129.84.218@out.solardns.com\r
68 X-SpamExperts-Outgoing-Class: unsure\r
69 X-SpamExperts-Outgoing-Evidence: Combined (0.53)\r
70 X-Recommended-Action: accept\r
71 X-BeenThere: notmuch@notmuchmail.org\r
72 X-Mailman-Version: 2.1.20\r
73 Precedence: list\r
74 List-Id: "Use and development of the notmuch mail system."\r
75  <notmuch.notmuchmail.org>\r
76 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
77  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
78 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
79 List-Post: <mailto:notmuch@notmuchmail.org>\r
80 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
81 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
82  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
83 X-List-Received-Date: Tue, 01 Mar 2016 18:35:38 -0000\r
84 \r
85 On Sun, 14 Feb 2016 13:05:28 +0100 (CET), Eric J <eric@deptj.eu> wrote:\r
86 >\r
87 \r
88 Resending with additional information:\r
89 \r
90 > I have been using notmuch for a while and I wanted to be able to use\r
91 > notmuch queries in some Tcl stuff I have been using for a rather longer\r
92 > while. I could have just called the notmuch CLI every time, but I thought\r
93 > "no, it's a library, there should be bindings".\r
94\r
95 > Bindings made me think of SWIG, which seems to have been tried for\r
96 > notmuch in the past but abandoned. However, with some time available...\r
97\r
98 > ... I can now, from Tcl, use the API functions from the library to\r
99 > create a database, close and open it, add messages, tag them, run queries\r
100 > and retrieve information about the results. I haven't tested every API\r
101 > function yet, but I will be able to go on with my own needs at least. It\r
102 > is only functions with pointer-to-pointer arguments that need special\r
103 > attention, and that is all in the SWIG interface file. You can see that at\r
104 > http://chiselapp.com/user/emj/repository/tclnotmuch/artifact/527aee944d?txt=1&ln=0\r
105 > - its about 50 lines (plus some blanks).\r
106\r
107 > That's a Fossil repository, with a home page at\r
108 > http://chiselapp.com/user/emj/repository/tclnotmuch , if anyone wants\r
109 > to look further. I think it may benefit from more wrapping from the Tcl\r
110 > side, just for usability.\r
111\r
112 > BTW, I have no idea if or how the interface file would have to be changed\r
113 > for other languages.\r
114 \r
115 The bindings work, but for a use case where simultaneous database access\r
116 from different processes is needed (e.g. processing emails as they\r
117 arrive), lost updates are possible for the following Tcl versions:\r
118 \r
119 * 8.5.18 built with threads (not the default)\r
120 * 8.6.[1-4] built with threads (default)\r
121 \r
122 However, the following Tcl versions do not have this problem:\r
123 \r
124 * 8.5.18 built without threads (default)\r
125 * 8.5.19 built with or without threads\r
126 * 8.6.[1-4] built without threads (not the default)\r
127 * 8.6.5 built with or without threads\r
128 \r
129 Earlier 8.5.x are presumably the same as 8.5.18.\r
130 \r
131 The problems, where they exist, are due to a weird interaction between\r
132 Tcl's thread implementation and Xapian's locking mechanism. The Tcl fix\r
133 in 8.5.19/8.6.5 was made for reasons unrelated to Xapian locking, but\r
134 fixes it anyway.\r
135 \r
136 Eric\r
137 -- \r
138 ms fnd in a lbry\r