unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] fix file descriptor leak with compressed email
@ 2019-09-22 18:48 James Troup
  2019-09-22 22:43 ` fix file descriptor leak David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: James Troup @ 2019-09-22 18:48 UTC (permalink / raw
  To: notmuch

Hi,

I'm trying notmuch for the first time using notmuch 0.29.1-2ubuntu1
backported to Ubuntu 19.04.  My email is stored in Gnus nnml format
and is approximately 410K mails with 60% compressed.  While trying to
run 'notmuch new' I very quickly ran into issues with 'Too many open
files', even after adjusting the maximum number of open file
descriptor up to 65K.

The patch below solved the problem for me.

diff -ur orig/notmuch-0.29.1/util/gmime-extra.c notmuch-0.29.1/util/gmime-extra.c
--- orig/notmuch-0.29.1/util/gmime-extra.c      2019-06-11 23:16:48.000000000 +0000
+++ notmuch-0.29.1/util/gmime-extra.c   2019-09-22 18:25:28.629546076 +0000
@@ -28,6 +28,8 @@
 
        /* ignore filter id */
        (void)g_mime_stream_filter_add ((GMimeStreamFilter *)gzstream, gzfilter);
+       g_object_unref(gzfilter);
+       g_object_unref(file_stream);
        return gzstream;
     } else {
        return file_stream;

-- 
James

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-13 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-22 18:48 [PATCH] fix file descriptor leak with compressed email James Troup
2019-09-22 22:43 ` fix file descriptor leak David Bremner
2019-09-22 22:44   ` [PATCH 1/2] test: known broken test file descriptor leak in gzip file open David Bremner
2019-09-22 22:44   ` [PATCH 2/2] util: unreference objects referenced by the returned stream obj David Bremner
2019-10-13 12:31   ` fix file descriptor leak David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).