From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E3C866DE0F94 for ; Fri, 10 May 2019 08:33:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.036 X-Spam-Level: X-Spam-Status: No, score=-0.036 tagged_above=-999 required=5 tests=[AWL=-0.035, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5bzSYJUZerH4 for ; Fri, 10 May 2019 08:33:09 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id ADC236DE0F80 for ; Fri, 10 May 2019 08:33:09 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hP7WE-0003Ww-GY for notmuch@notmuchmail.org; Fri, 10 May 2019 11:33:06 -0400 Received: (nullmailer pid 20777 invoked by uid 1000); Fri, 10 May 2019 15:33:04 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH] lib/message-file: close stream in destructor In-Reply-To: <20190510002324.31140-1-david@tethera.net> References: <20190510002324.31140-1-david@tethera.net> Date: Fri, 10 May 2019 12:33:04 -0300 Message-ID: <87sgtmgw9b.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Fri, 10 May 2019 15:33:11 -0000 David Bremner writes: > Without this, > > $ make time-test OPTIONS=--small > > leads to fatal errors from too many open files. > > Thanks to st-gourichon-fid for bringing this problem to my attention in IRC. > --- > lib/message-file.c | 3 +++ > 1 file changed, 3 insertions(+) > > The regression test could be improved, but I wanted to get a fix out > and hopefully into master, as this is a problem that seems > particularly likely to hit new users during their initial notmuch-new. > > diff --git a/lib/message-file.c b/lib/message-file.c > index 50855067..24c5fda4 100644 > --- a/lib/message-file.c > +++ b/lib/message-file.c > @@ -46,6 +46,9 @@ _notmuch_message_file_destructor (notmuch_message_file_t *message) > if (message->message) > g_object_unref (message->message); > > + if (message->stream) > + g_object_unref (message->stream); > + > return 0; > } > > -- > 2.20.1 I received several reports that this fixes the problem, so I've pushed it to master.