From: Keith Packard Date: Wed, 18 Nov 2009 02:33:42 +0000 (-0800) Subject: Fix "too many open files" bug by closing message files when done with them. X-Git-Tag: 0.1~465 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;ds=inline;h=d025e89ac7ccecc9a6bbea5e867fcc15589f81b5;hp=d025e89ac7ccecc9a6bbea5e867fcc15589f81b5;p=notmuch Fix "too many open files" bug by closing message files when done with them. 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 Edited-by: Carl Worth : 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. ---