]> git.notmuchmail.org Git - notmuch/commitdiff
Fix "too many open files" bug by closing message files when done with them.
authorKeith Packard <keithp@keithp.com>
Wed, 18 Nov 2009 02:33:42 +0000 (18:33 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 18 Nov 2009 02:37:13 +0000 (18:37 -0800)
The message file header parsing code parses only enough of the file to
find the desired header fields, then it leaves the file open until the
next header parsing call or when the message is no longer in use. If a
large number of messages end up being active, this will quickly run
out of file descriptors.

Here, we add support to explicitly close the message file within a
message, (_notmuch_message_close) and call that from thread
construction code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Edited-by: Carl Worth <cworth@cworth.org>:
Many portions of Keith's original patch have since been solved other
ways, (such as the code that changed the handling of the In-Reply-To
header). So the final version is clean enough that I think even Keith
would be happy to have his name on it.


No differences found