From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C09536DE21D3 for ; Mon, 20 Feb 2017 01:27:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.195 X-Spam-Level: X-Spam-Status: No, score=-0.195 tagged_above=-999 required=5 tests=[AWL=-0.175, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YUPKHG74gLTC for ; Mon, 20 Feb 2017 01:27:16 -0800 (PST) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by arlo.cworth.org (Postfix) with ESMTPS id A2DDD6DE21D1 for ; Mon, 20 Feb 2017 01:27:15 -0800 (PST) Received: by mail-lf0-f51.google.com with SMTP id g134so3363493lfe.1 for ; Mon, 20 Feb 2017 01:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623; h=date:from:subject:to:references:in-reply-to:user-agent:message-id :mime-version:content-transfer-encoding; bh=r3tm+slT15PfrVuXLSGF621Gsz16bfoyRlPnaCD9npQ=; b=o0PUUdPXIqLukTqQOOdfmXV/19LbdfWkX/n6doWFiuyvSTvP0hRGcnEDKFxnjglvTK giTzwguncOZoN6QE+hCm9fkUjXHaupu4DI5A2wH64GTv9qCD4TtoagD4GwG4rRhdq9tZ bI73ltfiZsqxr85KWSZE+tsme/aEl36mGrhP9Z44TisxaclEG2yFUjsZx2n7NQ/uizvh Dt+BzyFRjHYdzWTP8Xp0wYDZynj6Eu+M8b7lVuXgED1lCQD/HDQ/kswn8HDJhyGS04FR M40LhU8UnjuWNXZLrDWJ0OxOFjHH4UuxQ8AR00qDNKzkJXgS0rTLLQ6FY+c47saETsWc aBCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:references:in-reply-to :user-agent:message-id:mime-version:content-transfer-encoding; bh=r3tm+slT15PfrVuXLSGF621Gsz16bfoyRlPnaCD9npQ=; b=kVrF2lSBTvZA6nIJq3S2Jpjua7dyu7c7w82w2aD9Qml8JLpa4hDKhzj5kMCRLsGnxo Z0EhJxSipCTe/VVLe6cQXEaJ+pzXT3r36mFXM/mc7MUs7UPFcpvNjmLFTq4m8FuZRrls XYtXILCs5MLLVpqJxE/QI4BUmCa6f0UyjgJTG4mruSuTRKrolra4GGFmjelHjyM0fkgo 8i0Lwvr3LbKkrt0cWOz/1mI1OsojX9TrkcVCCwiuAxG4h5sqbG3u3ww52iJaNoQ1Df49 b14jDDPSasYSn7ewX7QQJ2lt0Fx9r82HQaFUNqETrJCu1Du189yVNKoDDexw+0QgvUeN 895g== X-Gm-Message-State: AMke39mE2RK7hq6YC2dfJh3sNAtUiNonkkhnwotrO0q2l6BnJmz5ImFNdm+9rFD/EfwYYA== X-Received: by 10.46.87.22 with SMTP id l22mr5022094ljb.68.1487582832402; Mon, 20 Feb 2017 01:27:12 -0800 (PST) Received: from localhost ([128.39.46.106]) by smtp.gmail.com with ESMTPSA id l133sm5056848lfg.40.2017.02.20.01.27.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2017 01:27:11 -0800 (PST) Date: Mon, 20 Feb 2017 09:27:09 +0000 From: Gaute Hope Subject: Re: add status value to _notmuch_message_ensure_metadata To: David Bremner , notmuch@notmuchmail.org References: <20170218144551.22925-1-david@tethera.net> In-Reply-To: <20170218144551.22925-1-david@tethera.net> User-Agent: astroid/v0.7-28-gadf1bf33 (https://github.com/astroidmail/astroid) Message-Id: <1487582192.57s86yczcg.astroid@strange.none> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Mon, 20 Feb 2017 09:27:16 -0000 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.=20 `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=20 tags: inbox unread=20 continue loading.. threads !=3D NULL thread !=3D NULL loading: 2:=20 tags:=20 threads !=3D NULL thread !=3D NULL loading: 3: 0000000000000009 tags: inbox unread=20 threads !=3D NULL thread !=3D NULL loading: 4:=20 tags:=20 threads !=3D NULL thread !=3D NULL loading: 5:=20 tags:=20 threads !=3D NULL thread !=3D NULL loading: 6: 0000000000000004 tags: inbox unread=20 threads !=3D NULL thread !=3D NULL loading: 7: 0000000000000006 tags: inbox unread=20 threads !=3D NULL thread !=3D NULL loading: 8: 000000000000000a tags: inbox signed unread=20 threads !=3D NULL thread !=3D NULL loading: 9: 0000000000000005 tags: inbox unread=20 ``` 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 !=3D NULL" << endl; } thread =3D notmuch_threads_get (threads); + if (thread =3D=3D NULL) { + cout << "thread =3D=3D NULL" << endl; + } else { + cout << "thread !=3D NULL" << endl; + } + cout << "loading: " << i; - std::string tid =3D notmuch_thread_get_thread_id (thread); + const char * cid =3D notmuch_thread_get_thread_id (thread); + std::string tid =3D ""; + if (cid !=3D NULL) tid =3D cid; cout << ": " << tid << endl; =20 /* get tags */ ``` - gaute =