Python bindings and Xapian exceptions

Carl Worth cworth at cworth.org
Thu Nov 4 12:31:48 PDT 2010


On Tue, 15 Jun 2010 11:03:55 +0200, "Sebastian Spaeth" <Sebastian at SSpaeth.de> 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.
> 
> 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.
> 
> 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.

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20101104/d88ca93a/attachment.pgp>


More information about the notmuch mailing list