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