diff src/master/login-process.c @ 8666:ca964325664e HEAD

If all login processes are in use and we can't create a new one, log a warning.
author Timo Sirainen <tss@iki.fi>
date Tue, 20 Jan 2009 15:04:25 -0500
parents 5a4fcfde3e91
children 1c76e82e0b36
line wrap: on
line diff
--- a/src/master/login-process.c	Tue Jan 20 12:31:58 2009 -0500
+++ b/src/master/login-process.c	Tue Jan 20 15:04:25 2009 -0500
@@ -23,6 +23,8 @@
 #include <syslog.h>
 #include <sys/stat.h>
 
+#define LOGIN_LIMIT_WARNING_MIN_INTERVAL (60*5)
+
 struct login_process {
 	struct child_process process;
 
@@ -801,6 +803,12 @@
 		if (group->oldest_prelogin_process != NULL &&
 		    group->oldest_prelogin_process->initialized)
 			login_process_destroy(group->oldest_prelogin_process);
+		else if (ioloop_time - group->last_limit_warning >
+			 LOGIN_LIMIT_WARNING_MIN_INTERVAL) {
+			group->last_limit_warning = ioloop_time;
+			i_warning("All login processes are in use. You may "
+				  "need to increase login_max_processes_count");
+		}
 	}
 
 	/* we want to respond fast when multiple clients are connecting