Re: add status value to _notmuch_message_ensure_metadata

Subject: Re: add status value to _notmuch_message_ensure_metadata

Date: Thu, 23 Feb 2017 07:59:51 -0400

To: Gaute Hope, notmuch@notmuchmail.org

Cc:

From: David Bremner


Gaute Hope <eg@gaute.vetsj.com> writes:


> Ideally if the error could be caught in `notmuch_threads_valid` or
> `notmuch_threads_get_thread` I think that would be the clearest, _st
> versions would be nice.

We can't really control when the exceptions happen, due to lazily
reading data from disk.  Looking more carefully at the backtrace, the
problem is actually inside the library, in particular some descendent of
notmuch_threads_get is not properly handling the error from
notmuch_message_get_tags.

> As I mentioned in
> id:1487582192.57s86yczcg.astroid@strange.none it seems that at later
> arbitrary iterations (without re-loading the threads object) the
> functions return valid data (even `notmuch_thread_get_tags` does). Can
> this data be trusted? I feel like this should all be invalid at this
> point.
>

I guess that's up to Xapian to decide, but I imagine anything after the
first exception is "undefined behaviour". Data is cached in memory per
message in the notmuch layer, so in principle later calls that don't
actually reach xapian could succeed.


Thread: