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 E3A5E40D14D for ; Fri, 5 Nov 2010 00:26:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.99 X-Spam-Level: X-Spam-Status: No, score=-1.99 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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=unavailable 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 3mQrEqdlgo2Q for ; Fri, 5 Nov 2010 00:25:56 -0700 (PDT) Received: from homiemail-a23.g.dreamhost.com (mailbigip.dreamhost.com [208.97.132.5]) by olra.theworths.org (Postfix) with ESMTP id 666314196F2 for ; Fri, 5 Nov 2010 00:25:56 -0700 (PDT) Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id B63E54B0063; Fri, 5 Nov 2010 00:25:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=iEOnNipH3l4Q4Xa9y9rRh7mpCaY TDOtWHHO6bDEG13SQfDjCS2RYD/O62OUZIYJ6KXsWFrBgwUdD7R9ttg8NPwSIZ6p z1TvZ6AF7x8f+JKmaLArV8oi9o2oDDpjWBIpCSgwL/WuNyu0kM0hgWV5OCaQgP1p uGwj2jQHerSmTfus= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=9iz3C79hKuC6Ldww2Bn/CldfOOo=; b=m t9b++7Dh8yZYxJB4zDhjK8IzVFeymmIAfN7A4h6BTCtdtn92W8ps4wyCd0F/BeaG zl/QxqBtabFKfA7bKUf4wnDWQVB+Zf7PMeFN0abZ/XzlPAQ/ImVSCHWxFiNgeKqz rQu69LGmILtCnEIyrm0+TkfG/pZozs6RIvfjWuQnVI= Received: from spaetzbook.sspaeth.de (mtec-hg-docking-2-dhcp-016.ethz.ch [82.130.121.16]) (Authenticated sender: fax@sspaeth.de) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id 2DA234B0060; Fri, 5 Nov 2010 00:25:52 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Fri, 05 Nov 2010 08:25:49 +0100 From: Sebastian Spaeth To: Carl Worth , notmuch Subject: Re: Python bindings and Xapian exceptions In-Reply-To: <871v70ril7.fsf@yoom.home.cworth.org> References: <87k4q7s43v.fsf@ut.hh.sledj.net> <878w6gis5g.fsf@SSpaeth.de> <871v70ril7.fsf@yoom.home.cworth.org> User-Agent: Notmuch/0.3.1-127-g6d93d20 (http://notmuchmail.org) Emacs/23.1.1 (x86_64-pc-linux-gnu) Date: Fri, 05 Nov 2010 08:25:38 +0100 Message-ID: <871v70z0y5.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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, 05 Nov 2010 07:26:08 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, 04 Nov 2010 12:31:48 -0700, Carl Worth wrote: > On Tue, 15 Jun 2010 11:03:55 +0200, "Sebastian Spaeth" wrote: > > > A Xapian exception occurred finding message: The revision being read > > > has been discarded - you should call Xapian::Database::reopen() and > > > retry the operation. > > > It makes the Python bindings almost useless to me. > > The proper fix, and a reason why I am not immediately hacking around in > > the python bindings is that notmuch the library would actually return a > > proper error value rather than print to stderr and quit. >=20 > For this particular case, I think the correct thing is for the library > to simply do the reopen() itself. That would already help a lot. But if there is for example a background task running that modifies the database a lot, reopening once might still not suffice. So we should try to reopen, yes. But if it still does not work after a reopen, we still need the possibility to fail gracefully while notifying the user about the failure. > But for exceptions in general, yes the notmuch library does need to be > fixed to allow the caller of functions to distinguish between things > like "no matches found" and "an exception occurred, so it's unknown if > any messages match the search". That's a general class of library > interface bugs that all need to be fixed. It does return a status for many operations already which is good. THere are only a few cases where it does not and the only one I know off-hand is find_message() which is useless at the moment as its result cannot be trusted.=20 What would probably also be good if notmuchlib could export a database.reopen() command so bindings can reopen the database in case they need to, without having to have xapian development headers installed and linking to it directly. Of course if libnotmuch reopens itself, that would not be required. Sebastian --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkzTsXMACgkQVYX1jMgnoGKFvgCaAoybkihQOoJSh6tG/PpRv+B/ GgAAnjhKXJT9tczjAIyPzLr0IJJxKWfr =Xvwz -----END PGP SIGNATURE----- --=-=-=--