From: Gaute Hope <eg@gaute.vetsj.com>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: add status value to _notmuch_message_ensure_metadata
Date: Mon, 20 Feb 2017 09:27:09 +0000 [thread overview]
Message-ID: <1487582192.57s86yczcg.astroid@strange.none> (raw)
In-Reply-To: <20170218144551.22925-1-david@tethera.net>
David Bremner writes on februar 18, 2017 15:45:
> In id:1487339566.mz8acpov1j.astroid@strange.none , Gaute provided a
> traceback of an uncaught Xapian::DatabaseModifiedError. The fix for
> this is simple, but somewhat intrusive.
>
> [...]
>
> I haven't tested against Gaute's test case (needs more boost than I
> have handy).
Hi, thanks this seems to get rid of the hard crash, the output from my test
case is attached below.
I have not yet tried to use any new status returns, it seems that the
immediate result is that `notmuch_threads_get ()` returns a valid (but
empty?) notmuch_thread_t * which results in
`notmuch_thread_get_thread_id ()` returning NULL. Strangely, at some
seemingly arbitrary intervals the methods seem to work correctly and
return a valid `notmuch_thread_t` struct.
`threads` and `thread` remain not NULL.
```
$ test/test_notmuch_standalone
db: running test query..
query: *, approx: 10 threads.
thread id to change: 0000000000000002, thread no: 3
restarting query..
moving to thread: 2
tags: inbox unread
tags: inbox unread
continue loading..
threads != NULL
thread != NULL
loading: 2:
tags:
threads != NULL
thread != NULL
loading: 3: 0000000000000009
tags: inbox unread
threads != NULL
thread != NULL
loading: 4:
tags:
threads != NULL
thread != NULL
loading: 5:
tags:
threads != NULL
thread != NULL
loading: 6: 0000000000000004
tags: inbox unread
threads != NULL
thread != NULL
loading: 7: 0000000000000006
tags: inbox unread
threads != NULL
thread != NULL
loading: 8: 000000000000000a
tags: inbox signed unread
threads != NULL
thread != NULL
loading: 9: 0000000000000005
tags: inbox unread
```
with the following changes made to the test program:
```
diff --git a/test/test_notmuch_standalone.cc b/test/test_notmuch_standalone.cc
index 5ef0a00..4634986 100644
--- a/test/test_notmuch_standalone.cc
+++ b/test/test_notmuch_standalone.cc
@@ -189,8 +189,16 @@ int main () {
cout << "threads != NULL" << endl;
}
thread = notmuch_threads_get (threads);
+ if (thread == NULL) {
+ cout << "thread == NULL" << endl;
+ } else {
+ cout << "thread != NULL" << endl;
+ }
+
cout << "loading: " << i;
- std::string tid = notmuch_thread_get_thread_id (thread);
+ const char * cid = notmuch_thread_get_thread_id (thread);
+ std::string tid = "";
+ if (cid != NULL) tid = cid;
cout << ": " << tid << endl;
/* get tags */
```
- gaute
next prev parent reply other threads:[~2017-02-20 9:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-18 14:45 add status value to _notmuch_message_ensure_metadata David Bremner
2017-02-18 14:45 ` [PATCH 1/8] lib: make _notmuch_message_ensure_metadata static David Bremner
2017-02-23 12:59 ` David Bremner
2017-02-18 14:45 ` [PATCH 2/8] lib: add status return to _notmuch_message_ensure_metadata David Bremner
2017-02-18 14:45 ` [PATCH 3/8] lib: propagate error return from some calls to _n_m_e_metadata David Bremner
2017-02-18 14:45 ` [PATCH 4/8] lib: push error from nme_metadata through nme_filename_list David Bremner
2017-02-18 14:45 ` [PATCH 5/8] lib: make _notmuch_message_ensure_property_map static David Bremner
2017-02-18 14:45 ` [PATCH 6/8] lib: propagate errors from nme_metadata through properties API David Bremner
2017-02-18 14:45 ` [PATCH 7/8] lib: add notmuch_message_get_database to public API David Bremner
2017-02-18 14:45 ` [PATCH 8/8] lib: add status return to notmuch_message_get_flag David Bremner
2017-02-20 9:27 ` Gaute Hope [this message]
2017-02-20 9:44 ` add status value to _notmuch_message_ensure_metadata Gaute Hope
2017-02-23 0:58 ` David Bremner
2017-02-23 7:46 ` Gaute Hope
2017-02-23 11:59 ` David Bremner
2017-02-24 2:00 ` [RFC patch 1/2] lib: add notmuch_database_reopen David Bremner
2017-02-24 2:00 ` [RFC patch 2/2] lib: handle DatabaseModifiedError in _n_message_ensure_metadata David Bremner
2017-02-24 2:49 ` David Bremner
2017-02-24 10:21 ` Gaute Hope
2017-02-24 11:40 ` David Bremner
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=1487582192.57s86yczcg.astroid@strange.none \
--to=eg@gaute.vetsj.com \
--cc=david@tethera.net \
--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).