From: W. Trevor King Date: Thu, 2 Oct 2014 20:48:00 +0000 (+1700) Subject: Re: [PATCH v4] lib: Simplify close and codify aborting atomic section X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a14ab44bcf54f246cb58aac7ce93e247a386dff7;p=notmuch-archives.git Re: [PATCH v4] lib: Simplify close and codify aborting atomic section --- diff --git a/fa/2436d0833c039aee62a745ff3296a4c9d1272d b/fa/2436d0833c039aee62a745ff3296a4c9d1272d new file mode 100644 index 000000000..a61b0fafe --- /dev/null +++ b/fa/2436d0833c039aee62a745ff3296a4c9d1272d @@ -0,0 +1,139 @@ +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 DDA28431FBC + for ; Thu, 2 Oct 2014 13:48:09 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.1 +X-Spam-Level: +X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + RCVD_IN_DNSWL_NONE=-0.0001] 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 K6go61IK3hVm for ; + Thu, 2 Oct 2014 13:48:03 -0700 (PDT) +Received: from resqmta-po-11v.sys.comcast.net (resqmta-po-11v.sys.comcast.net + [96.114.154.170]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1FCD5431FB6 + for ; Thu, 2 Oct 2014 13:48:03 -0700 (PDT) +Received: from resomta-po-06v.sys.comcast.net ([96.114.154.230]) + by resqmta-po-11v.sys.comcast.net with comcast + id yLo11o0044yXVJQ01Lo2MQ; Thu, 02 Oct 2014 20:48:02 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by resomta-po-06v.sys.comcast.net with comcast + id yLo11o00G152l3L01Lo1iB; Thu, 02 Oct 2014 20:48:02 +0000 +Received: by odin.tremily.us (Postfix, from userid 1000) + id 08EA713E90B1; Thu, 2 Oct 2014 13:48:00 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; + t=1412282881; bh=JMrnrfEIPqdohdSi37USN2exKMdWNWjqYfAyG+7MadM=; + h=Date:From:To:Cc:Subject:References:In-Reply-To; + b=n8+r4Q0XYEwZWpAfut/B+6lHDGM30modf/L6IzolAVXh9PcHi5oj/10g930KVzX6D + KMPaX3KqMeF+Nf9JZQ8TK/0i3Dk9Bk/XAtHvUSDwrLBHO35IwQMME0QfDX5gcQX9ex + SfzaV5056Rv7r0zra13sfQtPo0AAn3QI2Mrmgd6M= +Date: Thu, 2 Oct 2014 13:48:00 -0700 +From: "W. Trevor King" +To: Austin Clements +Subject: Re: [PATCH v4] lib: Simplify close and codify aborting atomic section +Message-ID: <20141002204800.GS3770@odin.tremily.us> +References: <87mw9ee0vf.fsf@csail.mit.edu> + <1412277548-3445-1-git-send-email-aclements@csail.mit.edu> + <20141002194134.GP3770@odin.tremily.us> + <87k34idx4i.fsf@csail.mit.edu> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="nqr+Djj1aAiKpg5f" +Content-Disposition: inline +In-Reply-To: <87k34idx4i.fsf@csail.mit.edu> +OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; + url=http://tremily.us/pubkey.txt +User-Agent: Mutt/1.5.23 (2014-03-12) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20140121; t=1412282882; + bh=H84DS2lTF1Ue5bjT2rsoettmnML/VuUVrRR5tdzOE68=; + h=Received:Received:Received:Date:From:To:Subject:Message-ID: + MIME-Version:Content-Type; + b=wlXB+5LllZd1EmNcHEF08SRnIJP9OAUbitqti1gqXtAYcDCi3ezMk0rEjvglj/nLo + QQXJEBSWHypAtAC9IegkBF5g3usdDpxMXXDvG8gqGC67fL26rvg44epnjSI4/NH4hH + 2ex8WUroJo6RJLzBMtMkg5FTsIsEZiRgNkd2YInGZc2YSswBoHfCLYXRTOUq+m8A1I + LgqDEHdqsk99NtNofmDjvqsTbdyngSBlrhssd0hkCnDsV29R5mu5QtudJz39X3PU5K + LJD/ECCMRku3bcK2orBXw+I7hWA8KeUvj+3EIjcuUDVgwAW0xB37GIvuuq/G9AH+wj + mLxEigsC8dPqA== +Cc: notmuch@notmuchmail.org +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: Thu, 02 Oct 2014 20:48:10 -0000 + + +--nqr+Djj1aAiKpg5f +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +On Thu, Oct 02, 2014 at 04:39:41PM -0400, Austin Clements wrote: +> On Thu, 02 Oct 2014, W. Trevor King wrote: +> > On Thu, Oct 02, 2014 at 03:19:08PM -0400, Austin Clements wrote: +> >> This patch simplifies notmuch_database_close to explicitly abort +> >> any outstanding transaction and then just call Database::close. +> >> This works for both read-only and read/write databases, takes +> >> care of committing changes, unifies the exception handling path, +> >> and codifies aborting outstanding transactions. +> > +> > I don't expect atomic blocks are particularly useful for read-only +> > connections. If they aren't, I'd quibble with the =E2=80=9CThis works = +for +> > both read-only=E2=80=A6=E2=80=9D wording above. If they are, I'd drop = +the +> > read/write +>=20 +> It's true that atomic sections aren't very useful on a read-only +> database, but we do allow them for symmetry. + +Heh, and they're no-ops since the beginning in 957f1ba3 (lib: Add +notmuch_database_{begin,end}_atomic, 2011-01-29). So both the commit +message and read/write check make sense. Quibble retracted. + +Cheers, +Trevor + +--=20 +This email may be signed or encrypted with GnuPG (http://www.gnupg.org). +For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy + +--nqr+Djj1aAiKpg5f +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: OpenPGP digital signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQIcBAEBAgAGBQJULbn/AAoJEG8/JgBt8ol8GeQP/1vp2y0f/I7ADIjn6izfaIS1 ++u099CWat1dmicKblwR9QROkPxEi/qRFzliHfMg4umIxbWHQFYmYm5w7b80MnXIz +1y6ShwE/bDD1bf7omaRZBOmnNZ/GZQsZea+0wdA4VNozQA9M1qBCD0DhxTklgfwe +oh2v7SyXPjY92auUYSUG5+B4hcNlwL1uIlp6tlqgOuuxQ6BOEc4TVF288MYRwlRV +UrK1Qaz5Ngk5oMhfZphTz5LbWE2YYNIvu9njpKjIatgCjGL1UAxbYAHQ631ZOObG +7VrGGttamGfzPQ5srlVxtnClqT3rtjQc/mRU3TNAfIfCGpbv+D3BEVscegFJEWOZ +7OjbRath6Ow8wyms5wlQTBcyM3b0qnJYMS/W1D64nV7YkRKxvolIh1ehum1YcvmJ +/PJzFaUhQR/PBrL/Bvz6GbQONDNLsKrZ+M7abgkeA4sd/diaU+U11yGkgBTDHVuo +iirBXhMQtqqurKScnd5lUDwFjJpRr5Z0VXuu868uolznLHilQk8wgm31qXxXCcm4 +TSghyT20EwIZZAcm+iZiZyDqoFyw6puLMsjTreT26+jtKEIDTL33USncaRxNqayi +BTRtmkZiUXf+SFLuKm3BeNFONx2S9bf9BeaKV+qCiy+q0pIRwZhc0KO/Z1SVqoZj +7fovHKHe34TAYtJCENBn +=xPir +-----END PGP SIGNATURE----- + +--nqr+Djj1aAiKpg5f--