Re: [PATCH v6 00/17] Fix 'notmuch new' atomicity issues
authorSebastian Spaeth <Sebastian@sspaeth.de>
Fri, 30 Sep 2011 09:21:38 +0000 (11:21 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:31 +0000 (09:39 -0800)
45/5ff575569f0f51b01e59360532c2d6cc9f42b8 [new file with mode: 0644]

diff --git a/45/5ff575569f0f51b01e59360532c2d6cc9f42b8 b/45/5ff575569f0f51b01e59360532c2d6cc9f42b8
new file mode 100644 (file)
index 0000000..847b4cf
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <Sebastian@sspaeth.de>\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 03546431FD0\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Sep 2011 02:21:44 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.09\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] 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 fdTwgFW4Y3q1 for <notmuch@notmuchmail.org>;\r
+       Fri, 30 Sep 2011 02:21:43 -0700 (PDT)\r
+Received: from homiemail-a15.g.dreamhost.com (caiajhbdcbhh.dreamhost.com\r
+       [208.97.132.177])\r
+       by olra.theworths.org (Postfix) with ESMTP id 94957431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Sep 2011 02:21:43 -0700 (PDT)\r
+Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1])\r
+       by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 0E95F76C06E;\r
+       Fri, 30 Sep 2011 02:21:43 -0700 (PDT)\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=sspaeth.de; h=from:to:cc:subject\r
+       :in-reply-to:references:date:message-id:mime-version:\r
+       content-type; q=dns; s=sspaeth.de; b=UJWKr0uRzTFSZJlRsBOoX0/7ozv\r
+       a/P2WtVNEv/Evq/NEXeTpGf2g9OUqv2z5zm0d4s5V3APRDPODg+9mxA9ExEdVgl6\r
+       buu7DiFmI2WBdUeHE940YGTUeQvL3vU/QtyLOJpHalWdvNy9PGTYjM1VN4cZHQ65\r
+       C+6e/9OkTBNR/2tI=\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sspaeth.de; h=from:to:cc\r
+       :subject:in-reply-to:references:date:message-id:mime-version:\r
+       content-type; s=sspaeth.de; bh=67zXSK08sMxBxHLlYC/qfIyGkaA=; b=G\r
+       HngMlAFHRKZVPJE24Aik51inWLJyM4ETMdw4JJGM1bBBERlzXO+dizY4VkCYlWAy\r
+       NSVXX5IytqgzA2KzRIrvwERE96kSvj9DCjGhK9EPA8+1OOkMQJf0+0HS7DEDL0LI\r
+       vK3ILWO1wdayyprWmyebCenk6SNL2/wi+Q/J06q9Qs=\r
+Received: from spaetzbook.sspaeth.de (unknown [84.55.203.213])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       (Authenticated sender: fax@sspaeth.de)\r
+       by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 4CA8376C069; \r
+       Fri, 30 Sep 2011 02:21:41 -0700 (PDT)\r
+Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation);\r
+       Fri, 30 Sep 2011 11:21:39 +0200\r
+From: Sebastian Spaeth <Sebastian@sspaeth.de>\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH v6 00/17] Fix 'notmuch new' atomicity issues\r
+In-Reply-To: <20110929150147.GC17905@mit.edu>\r
+References: <87ei34rnc5.fsf@yoom.home.cworth.org>\r
+       <1307822683-848-1-git-send-email-amdragon@mit.edu>\r
+       <87fwjgoc8f.fsf@SSpaeth.de> <20110929150147.GC17905@mit.edu>\r
+User-Agent: Notmuch/0.7-19-gee4579a (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 30 Sep 2011 11:21:38 +0200\r
+Message-ID: <87ehyy4c7x.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Cc: notmuch@notmuchmail.org\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: Fri, 30 Sep 2011 09:21:44 -0000\r
+\r
+--=-=-=\r
+\r
+On Thu, 29 Sep 2011 11:01:47 -0400, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Quoth Sebastian Spaeth on Sep 28 at  6:36 pm:\r
+> > db.find_message_by_filename("moo")\r
+> > Internal error: Failure to ensure database is writable\r
+> > (lib/directory.cc:100).\r
+\r
+> It appears that looking up a directory requires a writable database\r
+> because notmuch will try to *create* a database document for the\r
+> directory if one doesn't already exist.  This is clearly wrong\r
+> behavior for a "find" function.\r
+\r
+First of all, I consider libnotmuch exiting, taking python down, an\r
+outright bug. So we should modify this case to return:\r
+NOTMUCH_STATUS_READ_ONLY_DATABASE\r
+\r
+so I can at least give some sensible error than having an angry mob run\r
+with pitchforks towards me.\r
+\r
+Ideally, we don't need READ-WRITE dbs for the find :-)\r
+\r
+As it is, the same issue happens with the\r
+notmuch_database_get_directory call, which should be protected in the\r
+same manner (and probably has the same root cause). It is debatable\r
+whether get_directory should be creating a directory on demand, I guess,\r
+but it should never crash.\r
+\r
+I have documented this in the python bindings, so it's not super urgent.\r
+But it's dangerous and wrong nonetheless.\r
+\r
+Sebastian\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk6FiiMACgkQVYX1jMgnoGJMxgCfXCYv8R6R0hW39hXgCimR/nu8\r
+kVQAn0IdI1qr4ZT/tOHaksiQ/36WmH+N\r
+=kYfn\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r