Re: [PATCH] lib: Simplify close and codify aborting atomic section
authorAustin Clements <amdragon@mit.edu>
Mon, 22 Sep 2014 18:50:50 +0000 (18:50 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:41 +0000 (10:04 -0800)
1d/ad271754ca6d42db3c7d56c9420fea2be189aa [new file with mode: 0644]

diff --git a/1d/ad271754ca6d42db3c7d56c9420fea2be189aa b/1d/ad271754ca6d42db3c7d56c9420fea2be189aa
new file mode 100644 (file)
index 0000000..06f2655
--- /dev/null
@@ -0,0 +1,70 @@
+Return-Path: <amdragon@mit.edu>\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 1109C431FC0\r
+       for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 11:50:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 FvGeX6Z7Odgz for <notmuch@notmuchmail.org>;\r
+       Mon, 22 Sep 2014 11:50:52 -0700 (PDT)\r
+Received: from outgoing.csail.mit.edu (outgoing.csail.mit.edu [128.30.2.149])\r
+       by olra.theworths.org (Postfix) with ESMTP id 91494431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 11:50:52 -0700 (PDT)\r
+Received: from [104.131.20.129] (helo=awakeningjr)\r
+       by outgoing.csail.mit.edu with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)\r
+       (Exim 4.72) (envelope-from <amdragon@mit.edu>)\r
+       id 1XW8hH-00077r-BS; Mon, 22 Sep 2014 14:50:51 -0400\r
+Received: from amthrax by awakeningjr with local (Exim 4.84)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1XW8hG-00076x-JI; Mon, 22 Sep 2014 18:50:50 +0000\r
+Date: Mon, 22 Sep 2014 18:50:50 +0000\r
+From: Austin Clements <amdragon@mit.edu>\r
+To: "W. Trevor King" <wking@tremily.us>\r
+Subject: Re: [PATCH] lib: Simplify close and codify aborting atomic section\r
+Message-ID: <20140922185050.GB7970@csail.mit.edu>\r
+References: <1411400615-20934-1-git-send-email-amdragon@mit.edu>\r
+       <20140922165954.GI20827@odin.tremily.us>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <20140922165954.GI20827@odin.tremily.us>\r
+User-Agent: Mutt/1.5.23 (2014-03-12)\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: Mon, 22 Sep 2014 18:50:56 -0000\r
+\r
+Quoth W. Trevor King on Sep 22 at  9:59 am:\r
+> On Mon, Sep 22, 2014 at 11:43:35AM -0400, Austin Clements wrote:\r
+> > This patch simplifies notmuch_database_close to just call\r
+> > Database::close.  This works for both read-only and read/write\r
+> > databases, takes care of committing changes, unifies the exception\r
+> > handling path, and codifies aborting outstanding transactions.\r
+> \r
+> If we're dropping the flush call here, where will it be triggered\r
+> instead?  We'll need to flush/commit our changes to the database at\r
+> some point before closing.  Do clients now need an explicit\r
+> flush/commit command (explicit, client-initiated flushes sound like a\r
+> good idea to me).\r
+\r
+The call to Database::close implicitly flushes/commits, as mentioned\r
+in the comment in the patch, so there's no need for any new APIs or\r
+client changes.  The call to Database::flush in notmuch_database_close\r
+was entirely redundant with the call to Database::close.\r