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 A92C66DE1F22 for ; Sat, 25 Feb 2017 12:11:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-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 tS1Zi_GJ6cJH for ; Sat, 25 Feb 2017 12:11:19 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id E4A5C6DE1B46 for ; Sat, 25 Feb 2017 12:11:18 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1chifw-0006ah-9n; Sat, 25 Feb 2017 15:10:40 -0500 Received: (nullmailer pid 23510 invoked by uid 1000); Sat, 25 Feb 2017 20:11:16 -0000 From: David Bremner To: Jani Nikula , notmuch@notmuchmail.org, eg@gaute.vetsj.com Subject: Re: [PATCH 2/4] lib: add notmuch_database_reopen In-Reply-To: <87shn26rxx.fsf@nikula.org> References: <20170225034513.19427-1-david@tethera.net> <20170225034513.19427-3-david@tethera.net> <87shn26rxx.fsf@nikula.org> Date: Sat, 25 Feb 2017 16:11:16 -0400 Message-ID: <8760jy115n.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain 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: Sat, 25 Feb 2017 20:11:19 -0000 Jani Nikula writes: > On Fri, 24 Feb 2017, David Bremner wrote: >> The main expected use is to recover from a Xapian::DatabaseChanged >> exception. > > I guess the main question here is if this should be exposed from the > library or not. If the intention is to recover *within* the library, why > add new API? Yes that would work. Although as I mentioned on IRC, the API has been proposed a few times before. I don't mind either way, it could always be exposed later. In particular then I could feel less guilty about not yet providing any bindings. >> + notmuch->xapian_db->reopen (); >> + } catch (const Xapian::Error &error) { >> + if (! notmuch->exception_reported) { >> + _notmuch_database_log (notmuch, "Error: A Xapian exception reopening database: %s\n", >> + error.get_msg ().c_str ()); >> + notmuch->exception_reported = TRUE; >> + return NOTMUCH_STATUS_XAPIAN_EXCEPTION; >> + } > > Move the above return out of the if block? oh duh. good catch.