1 Return-Path: <felipe.contreras@gmail.com>
\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 5BB80431FAF
\r
6 for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 03:30:13 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id QL+9fZrMqOaw for <notmuch@notmuchmail.org>;
\r
17 Tue, 24 Apr 2012 03:30:12 -0700 (PDT)
\r
18 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com
\r
19 [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 7CC08431FAE for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 03:30:12 -0700
\r
23 Received: by eekb47 with SMTP id b47so223628eek.26
\r
24 for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 03:30:11 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
27 :cc:content-type:content-transfer-encoding;
\r
28 bh=Vig6HAsMBRXTl+T7ZiXCJXNXNwVSxOGSFe8qW7zXh+g=;
\r
29 b=JhNO6ytWZoI9xgzeEkQkM/TVSvdSwdbxsOOloAJPbGsQWUe63SrssYmZn7u1SQHTTV
\r
30 MePF6yBFE7KmHxncGe2cu5uyO7+CYqKgPN+ju4r9IjH6yoARe81TsAR/o9/ETOAPCbWJ
\r
31 wL1HO9YNcJsI8vOV4OejZeB/zLS072G2/CFtyWlDzr9yzNBnnWY0JsQrFnYRpNW1dHk5
\r
32 fP/lbrl0J+WJPrnXFOE1wj948WwPt8o+plHhoGNqTSIg8uFGRi+a6IAglO+EitV6gWG7
\r
33 JohA98SYH5ZJ8IU1al/rp0uupiBULQS/Wmh5St5DbGLqxRwHddqo0zZfsgbGD9RTuWz9
\r
36 Received: by 10.14.50.74 with SMTP id y50mr1344928eeb.107.1335263411113; Tue,
\r
37 24 Apr 2012 03:30:11 -0700 (PDT)
\r
38 Received: by 10.213.103.18 with HTTP; Tue, 24 Apr 2012 03:30:11 -0700 (PDT)
\r
39 In-Reply-To: <20120424011528.GA12459@mit.edu>
\r
40 References: <1335185032-13075-1-git-send-email-felipe.contreras@gmail.com>
\r
41 <CADv3eywAvyMuh3vWLwyuf0Ui_kskwp9875pGxCR1GTm7deN9Pg@mail.gmail.com>
\r
42 <CAMP44s3SyU4WVV0_McHWseNL=jmMnAXO2EdZK4Xk-wrCHPVD8A@mail.gmail.com>
\r
43 <CADv3eywb0tguYowTAK5Ag9YZ48zFZA0QJVNEj_cZcCpr-76Bbg@mail.gmail.com>
\r
44 <CAMP44s0=m+PmVBdVytHaYujpaZu=2WH+1F_VoMzpfXH+SS_ZmQ@mail.gmail.com>
\r
45 <CADv3eyxcu=2ZJ7GH3WULKMqe6FdmzhPtU6K9MLcCQ4m0cWmM7A@mail.gmail.com>
\r
46 <CAMP44s2qmPWZk=1N8L1aOnDb7b81kthNB-Gj798wdwBdtbBjFQ@mail.gmail.com>
\r
47 <20120424011528.GA12459@mit.edu>
\r
48 Date: Tue, 24 Apr 2012 13:30:11 +0300
\r
50 <CAMP44s2HbqaMxELGUJKZDaJx_pH9A1gqEJdiNPmvPjgGv79+Ow@mail.gmail.com>
\r
51 Subject: Re: [PATCH] ruby: make sure the database is closed
\r
52 From: Felipe Contreras <felipe.contreras@gmail.com>
\r
53 To: Austin Clements <amdragon@mit.edu>
\r
54 Content-Type: text/plain; charset=UTF-8
\r
55 Content-Transfer-Encoding: quoted-printable
\r
56 Cc: Ali Polatel <alip@exherbo.org>, notmuch@notmuchmail.org
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Tue, 24 Apr 2012 10:30:13 -0000
\r
71 On Tue, Apr 24, 2012 at 4:15 AM, Austin Clements <amdragon@mit.edu> wrote:
\r
72 > Quoth Felipe Contreras on Apr 24 at =C2=A03:45 am:
\r
73 >> On Tue, Apr 24, 2012 at 2:46 AM, Ali Polatel <alip@exherbo.org> wrote:
\r
74 >> > 2012/4/24 Felipe Contreras <felipe.contreras@gmail.com>:
\r
76 >> >> Personally I don't see why an object, like say a query would remain
\r
77 >> >> working correctly after the database is gone, either by calling
\r
78 >> >> .close() directly, or just loosing the pointer to the original object=
\r
80 >> >> I don't think users would expect that, or, even if they somehow found
\r
81 >> >> it useful, that most likely would be very seldom, and hardly worth
\r
82 >> >> worrying about it.
\r
84 >> > Working correctly is not expected but wouldn't it be more appropriate
\r
85 >> > to throw an exception rather than dumping core or printing on standard=
\r
88 >> Sure, if that was possible.
\r
90 >> > I wonder whether we can make both work somehow.
\r
91 >> > Maybe by using talloc explicitly and keeping reference pointers?
\r
92 >> > I don't know whether it's worth bothering.
\r
94 >> Maybe, I don't see how, that's just not how C works. Maybe talloc does
\r
95 >> have some way to figure out if a pointer has been freed, but I doubt
\r
96 >> that, and I can't find it by grepping through the API.
\r
98 >> Another option would be hook into talloc's destructor so we know when
\r
99 >> an object is freed and taint it, but then we would be overriding
\r
100 >> notmuch's destructor, and there's no way around that (unless we tap
\r
101 >> into talloc's internal structures). A way to workaround that would be
\r
102 >> to modify notmuch's API so that we can specify a destructor for
\r
103 >> notmuch objects, but that would be tedious, and I doubt a lof people
\r
104 >> beside us would benefit from that.
\r
106 > I believe (though I might be wrong) that bindings could simply
\r
107 > maintain their own talloc references to C objects returned by
\r
108 > libnotmuch to prevent them from being freed until the wrapper object
\r
109 > is garbage collected. =C2=A0This would require modifying all of the
\r
110 > library's _destroy functions to use talloc_find_parent_bytype and
\r
111 > talloc_unlink instead of simply calling talloc_free, but I don't think
\r
112 > this change would be particularly invasive and it certainly wouldn't
\r
113 > affect the library interface.
\r
115 That might work, but still, I don't see why this patch can't be applied.
\r