Re: A systematic way of handling Xapian lock errors?
[notmuch-archives.git] / 8b / e7265e6a0474f9f944f2f50994a006f5d00398
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 038FE431FC0;\r
6         Fri, 27 Nov 2009 05:01:55 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id 2xJKwtC7VROf; Fri, 27 Nov 2009 05:01:54 -0800 (PST)\r
11 Received: from cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id 0A8B0431FAE;\r
13         Fri, 27 Nov 2009 05:01:53 -0800 (PST)\r
14 From: Carl Worth <cworth@cworth.org>\r
15 To: djcb@djcbsoftware.nl, "notmuch\@notmuchmail org" <notmuch@notmuchmail.org>\r
16 In-Reply-To: <873a4480l1.wl%djcb@djcbsoftware.nl>\r
17 References: <873a4480l1.wl%djcb@djcbsoftware.nl>\r
18 Date: Fri, 27 Nov 2009 05:01:40 -0800\r
19 Message-ID: <87fx80qfyj.fsf@yoom.home.cworth.org>\r
20 MIME-Version: 1.0\r
21 Content-Type: text/plain; charset=us-ascii\r
22 Subject: Re: [notmuch] [PATCH] notmuch-count: make sure all created items\r
23  are freed, even in error paths\r
24 X-BeenThere: notmuch@notmuchmail.org\r
25 X-Mailman-Version: 2.1.12\r
26 Precedence: list\r
27 List-Id: "Use and development of the notmuch mail system."\r
28         <notmuch.notmuchmail.org>\r
29 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
30         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
31 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
32 List-Post: <mailto:notmuch@notmuchmail.org>\r
33 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
34 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
36 X-List-Received-Date: Fri, 27 Nov 2009 13:01:55 -0000\r
37 \r
38 On Tue, 24 Nov 2009 16:22:02 +0200, Dirk-Jan C. Binnema <djcb.bulk@gmail.com> wrote:\r
39\r
40 > Another minor patch, fixing a couple of resource leaks in error paths.\r
41 \r
42 Thanks, Dirk-Jan, but we don't actually need this kind of care in some\r
43 cases, because these aren't leaks in a permanent sense since they are\r
44 talloc-based. Instead these "leaks" simply mean that on the error paths\r
45 these objects will live slightly longer than normal, until the caller\r
46 frees the talloc context.\r
47 \r
48 And I'm perfectly happy to have slightly longer-lived objects in the\r
49 error paths, (while still guaranteeing leak-free behavior in all\r
50 cases). And I definitely like the easier-to-read-and-verify code that\r
51 comes with the early return values.\r
52 \r
53 Now, we do have to be careful if there are side effects from having an\r
54 object live longer, (such as holding a database write lock or\r
55 something). So if there's a fix for something like that in an error\r
56 path, then yes, we'll definitely want that.\r
57 \r
58 -Carl\r