--- /dev/null
+Return-Path: <eric@deptj.eu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 5A9946DE020D\r
+ for <notmuch@notmuchmail.org>; Thu, 18 Feb 2016 14:12:56 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.093\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.093 tagged_above=-999 required=5 tests=[AWL=0.003, \r
+ DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001,\r
+ RCVD_IN_MSPIKE_H3=-0.01, \r
+ RCVD_IN_MSPIKE_WL=-0.01, T_DKIM_INVALID=0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id mKIk1ItGPdjX for <notmuch@notmuchmail.org>;\r
+ Thu, 18 Feb 2016 14:12:54 -0800 (PST)\r
+Received: from mx1.solardns.com (mx1.solardns.com [109.73.127.119])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 0A5E56DE01D0\r
+ for <notmuch@notmuchmail.org>; Thu, 18 Feb 2016 14:12:54 -0800 (PST)\r
+Received: from [213.129.84.218] (helo=luna.solardns.com)\r
+ by mx1.solardns.com with esmtps (TLSv1.2:DHE-RSA-AES256-SHA:256)\r
+ (Exim 4.85) (envelope-from <eric@deptj.eu>) id 1aWOB9-000244-1E\r
+ for notmuch@notmuchmail.org; Thu, 18 Feb 2016 12:59:33 +0000\r
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deptj.eu;\r
+ s=default; h=Date:Message-ID:References:In-Reply-To:To:Subject:From;\r
+ bh=pOlqG3WJAPxDCGA86tc5ggLlSny+hZzn75sd54nBvns=; b=blRaHY+xXPlT9rYHZPfstcfss5\r
+ sznAj8C5xIGlrpFsD5/RRA/9qz0yNvEaocuk9pbefTay5QZXXeeZgmAXbxHMORopL8kI8D8n0pBvH\r
+ L47PNpj3VqtJjHV9zub7e3zv3DCp5/oGbnFK4Q3B98CSzUaTW1ZKyFI+Zw5SSxKBrUmI=;\r
+Received: from [92.135.160.170] (port=45007 helo=bruno.deptj.eu)\r
+ by luna.solardns.com with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256)\r
+ (Exim 4.86) (envelope-from <eric@deptj.eu>) id 1aWOB7-00231G-4u\r
+ for notmuch@notmuchmail.org; Thu, 18 Feb 2016 12:59:29 +0000\r
+Received: from eric by bruno.deptj.eu with local (Exim 4.84)\r
+ (envelope-from <eric@deptj.eu>) id 1aWOB5-0005eU-Vb\r
+ for notmuch@notmuchmail.org; Thu, 18 Feb 2016 13:59:28 +0100\r
+From: Eric J <eric@deptj.eu>\r
+Subject: Re: Lost updates to Notmuch database\r
+To: notmuch@notmuchmail.org\r
+In-Reply-To: <871t8avnhq.fsf@zancas.localnet>\r
+References: <337393ce5e2484d64f837a44b2c4f2ea32f91295-NM@bruno.deptj.eu>\r
+ <871t8avnhq.fsf@zancas.localnet>\r
+Message-ID: <ae82f004d3f4e2710f74ee6437a2041c05f41588-NM@bruno.deptj.eu>\r
+Date: Thu, 18 Feb 2016 13:59:28 +0100 (CET)\r
+X-AuthUser: deptjeu\r
+X-Filter-ID:\r
+ s0sct1PQhAABKnZB5plbIZxxbsbMXbbOVqDrOlLQDPCKLoLP9dSDpksiPa3sfcfQiw3bi2TEXpBy\r
+ KOgMDJLxZ2gLr13hkJnqYlE8dI2PqoFC/lGsrXcsS0xY0J18f6o7xB66CWvXcfKDfXjTU++u6/cO\r
+ QQommvORTE20Rks847c6row+/zX/W00wt70Tbqz7ZuM7jUXIESohoO51xWmU8U0XxLGz4gGrl7np\r
+ YUMMsx7Zx6js8RMGZ+eyCM03IideZE/8G6RrW+hPYRmHOym9VEp4OmAp9SwcFw57ijAOXur1H/aA\r
+ warQpYDOYx/6JtUOKIpz/KyJk6xidDbrtJGeIvwS+mRNB2u5eXMTyiRDCl4blv/7/GYDGL6pBAPx\r
+ 3RhxuHrpSpJU4PQlqFj9797wgsGhIeDBws4kvu4hgViYIJSOH7FelTFEA57OugCjQqJvq5XDlSi1\r
+ S/CAqp6x6giLUpAadaOpLL7vzAlHz9Vt0lJbH3q7FSJEAvmcpRDg+DcXMCx8qKfWo/2nfeswSb/v\r
+ XOidX4Ts4xdG+C13IyWeZaJClvAWyUAUCSYHhmge3quet8geXjZWRvaT/RbJ/nX/IFFm7SbdEzck\r
+ 901Ob2Iq9tC/Vh1lis0iI/S1HLwoHXf0\r
+X-Report-Abuse-To: spam@mx1.solardns.com\r
+X-Filter-Fingerprint:\r
+ IFrWXGses7OKB5S5G8/dJdIz5bb8V0ykx8BnFBnunHBA3cTUQ1R++keuE7RDJ8Kg3RbMLUalw1oC\r
+ mj99/u+Poh38tEMU4IgC4sNz49qn3HHnhRv/ZJ3kEy8bfiAr+Fb/UpndEJ0YoaLytXXo8BMTaVt0\r
+ ARHRi6XGuAluI1udprGClI6bm+u9ssQgM5AHe3Zacv4uJct5wtJvPpZ2dlBHCwDSxr3Vz+LJ/RhM\r
+ 2JZ0ECN5dnq47RWft7iCyM9+PbHelB4qP9S6mTzNwoPraFy6ieiDqMHb2a0eZvGOvr7RaxKWGCKO\r
+ us9nABr0Pk/4CplP\r
+X-Originating-IP: 213.129.84.218\r
+X-SpamExperts-Domain: out.solardns.com\r
+X-SpamExperts-Username: 213.129.84.218\r
+Authentication-Results: solardns.com;\r
+ auth=pass smtp.auth=213.129.84.218@out.solardns.com\r
+X-SpamExperts-Outgoing-Class: ham\r
+X-SpamExperts-Outgoing-Evidence: Combined (0.28)\r
+X-Recommended-Action: accept\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 18 Feb 2016 22:12:56 -0000\r
+\r
+On Wed, 17 Feb 2016 21:03:13 -0400, David Bremner <david@tethera.net> wrote:\r
+> Eric J <eric@deptj.eu> writes:\r
+> \r
+> > However, if I do it twice, in different processes, at the same time, one\r
+> > file is added and tagged properly, the other is not (totally unfindable\r
+> > by notmuch search). Neither process reports any error, and they both log\r
+> > their actions normally. Actually a third simultaneous process also fails\r
+> > to leave any result in the database.\r
+> \r
+> It should be impossible for more than one process to open a Xapian\r
+> database for writing at the same time. So if the processes are really\r
+> running in parallel, you should be getting error codes from the later\r
+> calls to notmuch_database_open{_verbose}. You claim that's not\r
+> happening, which is puzzling. Maybe you can try to duplicate your\r
+> problem with a tiny C program.\r
+\r
+Thanks David. Impossible? - yes, but if I do just the open in two\r
+interactive sessions (the Tcl interface makes this easy), I get the\r
+following from "lsof flintlock":\r
+\r
+COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\r
+cat 21408 eric 5w REG 8,9 0 667773 flintlock\r
+cat 21418 eric 5w REG 8,9 0 667773 flintlock\r
+\r
+So, open for writing, but not locked (the processes have the right\r
+parents).\r
+\r
+I managed to catch a run of "notmuch new" with "lsof -r5 flintlock":\r
+\r
+COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\r
+cat 20763 eric 3ww REG 8,9 0 667773 flintlock\r
+\r
+which is open for writing and (partially) locked, so it must be doing\r
+something that I'm not. I obviously need to go carefully through the\r
+code to see what that is (and experiment in C if I can't find it!).\r
+\r
+I don't have the _verbose functions BTW, still on 0.18.1 - I thought I\r
+would get a proof-of-concept before upgrading notmuch, but...\r
+\r
+Thanks again,\r
+\r
+Eric\r
+-- \r
+ms fnd in a lbry\r