Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types
authorPatrick Totzke <patricktotzke@googlemail.com>
Tue, 6 Dec 2011 11:44:01 +0000 (11:44 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:36 +0000 (09:40 -0800)
39/820e68c7680bc0379b4cc21a3180bdd01362dc [new file with mode: 0644]

diff --git a/39/820e68c7680bc0379b4cc21a3180bdd01362dc b/39/820e68c7680bc0379b4cc21a3180bdd01362dc
new file mode 100644 (file)
index 0000000..6331da3
--- /dev/null
@@ -0,0 +1,138 @@
+Return-Path: <patricktotzke@googlemail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 19F61429E27\r
+       for <notmuch@notmuchmail.org>; Tue,  6 Dec 2011 03:44:48 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id DWussa4eLXux for <notmuch@notmuchmail.org>;\r
+       Tue,  6 Dec 2011 03:44:47 -0800 (PST)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 484C4429E26   for <notmuch@notmuchmail.org>; Tue,  6 Dec 2011 03:44:47 -0800\r
+ (PST)\r
+Received: by eekb57 with SMTP id b57so1595943eek.26\r
+       for <notmuch@notmuchmail.org>; Tue, 06 Dec 2011 03:44:44 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=googlemail.com; s=gamma;\r
+       h=message-id:content-type:mime-version:references:to:in-reply-to:from\r
+       :subject:date; bh=NLOmGwuv61XBT5f0stzWWibhs7vqXfA+rP3UNEg5BXs=;\r
+       b=AKftbS92LbJ1MquDT884578KStQNkZPhDqJovjG0GG43aUCjUjl/WA92oJI+RKZFDt\r
+       sxyKRW18B6JZiruJva9lJ/QiGJ9OxN8CEF2tcW36esc83R3TPPVQ9n/yo8Gc5aTZ5+SU\r
+       R/fZ4rg8LZEb+n9S2cuMF6/PF3NVD77CNfYf8=\r
+Received: by 10.14.9.165 with SMTP id 37mr2504189eet.106.1323171884420;\r
+       Tue, 06 Dec 2011 03:44:44 -0800 (PST)\r
+Received: from localhost (dhcp-91-036.inf.ed.ac.uk. [129.215.91.36])\r
+       by mx.google.com with ESMTPS id j9sm34009254bkd.2.2011.12.06.03.44.41\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 06 Dec 2011 03:44:42 -0800 (PST)\r
+Message-ID: <4ede002a.0922cc0a.207d.3460@mx.google.com>\r
+Content-Type: multipart/mixed; boundary="===============1876771212=="\r
+MIME-Version: 1.0\r
+References:\r
+ <1318198374-926-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+       <1318198374-926-2-git-send-email-4winter@informatik.uni-hamburg.de>\r
+       <4eddf2b1.4288980a.0b74.5557@mx.google.com> <87mxb66jit.fsf@SSpaeth.de>\r
+To: Sebastian Spaeth <Sebastian@SSpaeth.de>,\r
+       Justus Winter <4winter@informatik.uni-hamburg.de>, notmuch@notmuchmail.org\r
+In-Reply-To: <87mxb66jit.fsf@SSpaeth.de>\r
+From: Patrick Totzke <patricktotzke@googlemail.com>\r
+Subject: Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types\r
+Date: Tue, 06 Dec 2011 11:44:01 +0000\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 06 Dec 2011 11:44:48 -0000\r
+\r
+--===============1876771212==\r
+Content-Type: text/plain; charset="utf-8"\r
+MIME-Version: 1.0\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+yes, i can. here's how to reproduce it on master:\r
+\r
+fire a `notmuch tag +TEST1 '*'`, which should block the db for a while.\r
+Then use the attached script to write to the index (this could make a nice\r
+second testcase for the bindings in case the test body is large enough).\r
+\r
+On master, the script fails like this:\r
+\r
+A Xapian exception occurred opening database: Unable to get write lock on\r
+/home/pazz/mail/.notmuch/xapian: already locked\r
+Segmentation fault\r
+\r
+When you reset using `git reset e92b438f46a3a` (to 4winters first patch), t=\r
+he script\r
+fails like this, which is the intended behaviour:\r
+\r
+A Xapian exception occurred opening database: Unable to get write lock on /=\r
+home/pazz/mail/.notmuch/xapian: already locked\r
+Traceback (most recent call last):\r
+  File "./p.py", line 3, in <module>\r
+    db =3D notmuch.Database(mode=3Dnotmuch.Database.MODE.READ_WRITE)\r
+  File "/usr/local/lib/python2.7/dist-packages/notmuch/database.py", line 1=\r
+21, in __init__\r
+    self.open(path, mode)\r
+  File "/usr/local/lib/python2.7/dist-packages/notmuch/database.py", line 1=\r
+73, in open\r
+    raise NotmuchError(message=3D"Could not open the specified database")\r
+notmuch.globals.NotmuchError: Could not open the specified database\r
+\r
+\r
+best,\r
+/p\r
+\r
+\r
+Quoting Sebastian Spaeth (2011-12-06 11:12:42)\r
+>On Tue, 06 Dec 2011 10:46:31 +0000, Patrick Totzke <patricktotzke@googlema=\r
+il.com> wrote:\r
+>> This commit breaks raising XapianErrors for me.\r
+>> =\r
+\r
+>> If I lock the index with some `notmuch tag +test '*'`\r
+>> and try to write to it in alot, i get a segfault and\r
+>> the following on stderr:\r
+>> =\r
+\r
+>> Xapian exception occurred opening database: Unable to get write lock on\r
+>> /home/pazz/mail/.notmuch/xapian: already locked\r
+>\r
+>Can you confirm that this only occurs with this patch and not without?\r
+>To be honest, I don't see how the patch would change things in a way\r
+>that make it throw XapianErrors that would not also occur before this\r
+>patch.\r
+>\r
+>Sebastian\r
+\r
+--===============1876771212==\r
+Content-Type: text/x-python; charset="us-ascii"\r
+MIME-Version: 1.0\r
+Content-Transfer-Encoding: 7bit\r
+Content-Disposition: attachment; filename="exceptiontest.py"\r
+\r
+#!/usr/bin/python\r
+import notmuch\r
+db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
+q_new = notmuch.Query(db, '*')\r
+for m in q_new.search_messages():\r
+    m.add_tag('TEST')\r
+\r
+--===============1876771212==--\r