unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>
To: Notmuch development list <notmuch@notmuchmail.org>
Subject: Unhandled Xapian exception
Date: Fri, 23 Apr 2010 13:21:56 +0200	[thread overview]
Message-ID: <87aasul8h7.fsf@SSpaeth.de> (raw)

Hi Carl,

dme complained that my python bindings abort with
Xapian::DatabaseModifiedException when doing a
Database.find_message('id'). But libnotmuch.so terminates before python
has even a chance to catch an execption, and I think it boils down to this:

http://git.notmuchmail.org/git/notmuch/blob/ec6d78acf12d5c8fe6d10d091adee6516bf48d8a:/lib/database.cc#l276

find_message() which calls:
find_doc_ids_for_term() in lib/database.cc which contains:

 *begin = notmuch->xapian_db->postlist_begin (term);
   *end = notmuch->xapian_db->postlist_end (term);

without doing any catching. According to Olly Betts this can possibly
throw such an exception when the Database has been modified.

I propose to try..catch this code block and rather than returning VOID
it could return NOTMUCH_STATUS_SUCCESS or NOTMUCH_XAPIAN_EXCEPTION.
Not sure how "notmuch_database_find_message" would notify the caller of
such an exception situation though. The only possible failure value is
NULL (which also means did not find such a message).

Sebastian

             reply	other threads:[~2010-04-23 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 11:21 Sebastian Spaeth [this message]
2010-04-24 14:38 ` Unhandled Xapian exception Carl Worth
2010-04-26  9:28   ` Sebastian Spaeth
2010-04-26 10:57   ` David Edmondson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aasul8h7.fsf@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).