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 44ED04196F0 for ; Thu, 4 Nov 2010 12:32:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.89 X-Spam-Level: X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01] autolearn=ham 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 I+W+SBKCzaHP; Thu, 4 Nov 2010 12:31:48 -0700 (PDT) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id AEBD040D156; Thu, 4 Nov 2010 12:31:48 -0700 (PDT) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 6A938254102; Thu, 4 Nov 2010 12:31:48 -0700 (PDT) From: Carl Worth To: Sebastian Spaeth , notmuch Subject: Re: Python bindings and Xapian exceptions In-Reply-To: <878w6gis5g.fsf@SSpaeth.de> References: <87k4q7s43v.fsf@ut.hh.sledj.net> <878w6gis5g.fsf@SSpaeth.de> User-Agent: Notmuch/0.4 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 04 Nov 2010 12:31:48 -0700 Message-ID: <871v70ril7.fsf@yoom.home.cworth.org> 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: Thu, 04 Nov 2010 19:32:00 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable 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. >=20 > Not sure, if the python bindings should simply drop and reopen a > database connection in that case? But I am not sure if libnotmuch.so > still simply exits on such an error case. >=20 > 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. For this particular case, I think the correct thing is for the library to simply do the reopen() itself. That way we can pretend that Xapian doesn't make readers block on writers. 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. =2DCarl =2D-=20 carl.d.worth@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFM0wok6JDdNq8qSWgRAuf1AJsHfbfw6HCVZ16F4Z4lqKpdNnn0PACdHSyP UH51CHsHkDx8hs1tmT5MojI= =Omjk -----END PGP SIGNATURE----- --=-=-=--