dovecot-1.2: If epoll_create() fails with EMFILE, suggest increa...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 2 21:10:39 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/697f380acfbb
changeset: 8890:697f380acfbb
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 02 14:10:16 2009 -0400
description:
If epoll_create() fails with EMFILE, suggest increasing epoll's max_user_instances.

diffstat:

1 file changed, 8 insertions(+), 2 deletions(-)
src/lib/ioloop-epoll.c |   10 ++++++++--

diffs (20 lines):

diff -r c5cb1f27caea -r 697f380acfbb src/lib/ioloop-epoll.c
--- a/src/lib/ioloop-epoll.c	Thu Apr 02 14:00:31 2009 -0400
+++ b/src/lib/ioloop-epoll.c	Thu Apr 02 14:10:16 2009 -0400
@@ -35,8 +35,14 @@ void io_loop_handler_init(struct ioloop 
 	i_array_init(&ctx->fd_index, initial_fd_count);
 
 	ctx->epfd = epoll_create(initial_fd_count);
-	if (ctx->epfd < 0)
-		i_fatal("epoll_create(): %m");
+	if (ctx->epfd < 0) {
+		if (errno != EMFILE)
+			i_fatal("epoll_create(): %m");
+		else {
+			i_fatal("epoll_create(): %m (you may need to increase "
+				"/proc/sys/fs/epoll/max_user_instances)");
+		}
+	}
 	fd_close_on_exec(ctx->epfd, TRUE);
 }
 


More information about the dovecot-cvs mailing list