From bdeac9d8d8e0bb6e49bc7f6e6e2a0aaac009a3a8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 31 Dec 2014 09:28:04 +0100 Subject: [PATCH] Re: DatabaseModifiedErrors causing troubles --- b9/fcd6486156fc8877aa822053786502a4ffd8bc | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 b9/fcd6486156fc8877aa822053786502a4ffd8bc diff --git a/b9/fcd6486156fc8877aa822053786502a4ffd8bc b/b9/fcd6486156fc8877aa822053786502a4ffd8bc new file mode 100644 index 000000000..c7e6bec12 --- /dev/null +++ b/b9/fcd6486156fc8877aa822053786502a4ffd8bc @@ -0,0 +1,89 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4A145431FDA + for ; Wed, 31 Dec 2014 00:28:14 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id UuFgWwNrL1Q8 for ; + Wed, 31 Dec 2014 00:28:11 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1B16D431FCB + for ; Wed, 31 Dec 2014 00:28:11 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1Y6EdV-0004Uq-Pu; Wed, 31 Dec 2014 04:28:09 -0400 +Received: (nullmailer pid 3100 invoked by uid 1000); Wed, 31 Dec 2014 + 08:28:04 -0000 +From: David Bremner +To: Gaute Hope , notmuch +Subject: Re: DatabaseModifiedErrors causing troubles +In-Reply-To: + +References: + +User-Agent: Notmuch/0.19+7~g5d7f7a6 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Wed, 31 Dec 2014 09:28:04 +0100 +Message-ID: <87bnmkgr57.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Wed, 31 Dec 2014 08:28:14 -0000 + +Gaute Hope writes: + +> I can work around this by checking for a NULL pointer returned from +> notmuch_query_search_threads () and re-open the database +> (notmuch_database_close () -> notmuch_database_open ()). But I have no +> way of knowing programatically if this really is the error that has +> happened. There should be some way of propagating the error +> information or (even better for my case; for notmuch to reopen the +> database), one option is the Gmime way of passing an pointer to an +> error structure that is filled up by the notmuch interface function. + +Hi Gaute; + +Sorry this sequence of postings of yours kindof fell down a well. In +general there seems to be not very much enthusiasm for the GError +solution. We can do something less fancy with the series at + + id:1419788030-10567-2-git-send-email-david@tethera.net + +In particular id:1419788030-10567-6-git-send-email-david@tethera.net +replaces the printfs with saving to a status string accessible from +notmuch_database_t. + +I _think_ this could solve your problem, although doing strcmp on error +message might not be ideal. Overall this is much less api breakage +(only open and create need to be wrapped). + +We could also consider really updating the api for those NULL returning +functions, but it seems less bad to me than the count functions updated +in this series + + id:1419971380-10307-2-git-send-email-david@tethera.net + +Let me know what you think, + +David -- 2.26.2