From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CGhNOLMY+V7mYwAA0tVLHw (envelope-from ) for ; Sun, 28 Jun 2020 22:24:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YGgrNLMY+V7kKgAAB5/wlQ (envelope-from ) for ; Sun, 28 Jun 2020 22:24:51 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 59C0394053D for ; Sun, 28 Jun 2020 22:24:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 793586DE13DE; Sun, 28 Jun 2020 15:24:46 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 YcJ-TzGu_gUg; Sun, 28 Jun 2020 15:24:45 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 17D606DE13D3; Sun, 28 Jun 2020 15:24:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8BD226DE13D3 for ; Sun, 28 Jun 2020 15:24:43 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 7fdMyQQ1b4ax for ; Sun, 28 Jun 2020 15:24:42 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTP id C645D6DE13C8 for ; Sun, 28 Jun 2020 15:24:42 -0700 (PDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3229F61417; Sun, 28 Jun 2020 18:24:42 -0400 (EDT) Received: (nullmailer pid 1975860 invoked by uid 1000); Sun, 28 Jun 2020 22:24:40 -0000 From: David Bremner To: Floris Bruynooghe , notmuch@notmuchmail.org Subject: Re: Usage after database close In-Reply-To: <87a70mlu24.fsf@tethera.net> References: <87d05je1j6.fsf@powell.devork.be> <87d05jkvry.fsf@tethera.net> <875zbazzlu.fsf@powell.devork.be> <87a70mlu24.fsf@tethera.net> Date: Sun, 28 Jun 2020 19:24:40 -0300 Message-ID: <877dvqltg7.fsf@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -1.01 X-TUID: mWBYJZ5Cg9Lk David Bremner writes: >> But part of my question is, *should* this be improved? Am I >> interpreting notmuch's intended API correctly? > > Well, I agree you should get NOTMUCH_STATUS_XAPIAN_EXCEPTION back, or we > should change the docs to say "just don't do that". Arguments in favour of the latter: 1) several API calls don't return notmuch_status_t, so can't literally return NOTMUCH_STATUS_XAPIAN_EXCEPTION 2) notmuch_message_get_{message,thread}_id promise never to return NULL, has no way to report errors. I think it would probably make sense to say (if notmuch_database_reopen) existed, that if you call notmuch_database_close, don't call anything else except notmuch_database_reopen or notmuch_database_destroy. d