Re: [PATCH v4] lib: Simplify close and codify aborting atomic section
authorW. Trevor King <wking@tremily.us>
Thu, 2 Oct 2014 20:48:00 +0000 (13:48 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:52 +0000 (10:04 -0800)
fa/2436d0833c039aee62a745ff3296a4c9d1272d [new file with mode: 0644]

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