dovecot-1.1: dbox sync rebuilding: Don't leave all maildir file ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 2 20:18:15 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/8ae5268762b5
changeset: 7594:8ae5268762b5
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 02 20:18:11 2008 +0300
description:
dbox sync rebuilding: Don't leave all maildir file fds open until the end of
sync. It can cause too many open files.

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-storage/index/dbox/dbox-sync-rebuild.c |    6 +++++-

diffs (17 lines):

diff -r 2d367594b41c -r 8ae5268762b5 src/lib-storage/index/dbox/dbox-sync-rebuild.c
--- a/src/lib-storage/index/dbox/dbox-sync-rebuild.c	Mon Jun 02 20:01:42 2008 +0300
+++ b/src/lib-storage/index/dbox/dbox-sync-rebuild.c	Mon Jun 02 20:18:11 2008 +0300
@@ -254,8 +254,12 @@ dbox_sync_index_maildir_file(struct dbox
 	}
 
 	file = dbox_file_init_new_maildir(ctx->mbox, fname);
-	if ((ret = dbox_sync_index_file_next(ctx, file, &offset)) > 0)
+	if ((ret = dbox_sync_index_file_next(ctx, file, &offset)) > 0) {
 		dbox_index_append_file(ctx->append_ctx, file);
+		/* appending referenced the file, so make sure it gets closed
+		   so we don't have too many open files. */
+		dbox_file_close(file);
+	}
 	dbox_file_unref(&file);
 	return ret < 0 ? -1 : 0;
 }


More information about the dovecot-cvs mailing list