dovecot-1.2: If a process dies because it's out of memory, menti...

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 5 00:07:00 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/66ecd60b7ea2
changeset: 8223:66ecd60b7ea2
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 05 00:06:56 2008 +0300
description:
If a process dies because it's out of memory, mention *_process_size setting in the error message.

diffstat:

1 file changed, 19 insertions(+), 2 deletions(-)
src/master/child-process.c |   21 +++++++++++++++++++--

diffs (45 lines):

diff -r 1155c1f7fed8 -r 66ecd60b7ea2 src/master/child-process.c
--- a/src/master/child-process.c	Wed Oct 01 16:07:57 2008 +0300
+++ b/src/master/child-process.c	Sun Oct 05 00:06:56 2008 +0300
@@ -89,7 +89,8 @@ void client_process_exec_argv(const char
 	execv(executable, (char **)argv);
 }
 
-static const char *get_exit_status_message(enum fatal_exit_status status)
+static const char *get_exit_status_message(enum fatal_exit_status status,
+					   enum process_type process_type)
 {
 	switch (status) {
 	case FATAL_LOGOPEN:
@@ -99,6 +100,21 @@ static const char *get_exit_status_messa
 	case FATAL_LOGERROR:
 		return "Internal logging error";
 	case FATAL_OUTOFMEM:
+		switch (process_type) {
+		case PROCESS_TYPE_AUTH:
+		case PROCESS_TYPE_AUTH_WORKER:
+			return "Out of memory - see auth_process_size setting";
+		case PROCESS_TYPE_LOGIN:
+			return "Out of memory - see login_process_size setting";
+		case PROCESS_TYPE_IMAP:
+		case PROCESS_TYPE_POP3:
+			return "Out of memory - see mail_process_size setting";
+		case PROCESS_TYPE_UNKNOWN:
+		case PROCESS_TYPE_SSL_PARAM:
+		case PROCESS_TYPE_DICT:
+		case PROCESS_TYPE_MAX:
+			break;
+		}
 		return "Out of memory";
 	case FATAL_EXEC:
 		return "exec() failed";
@@ -148,7 +164,8 @@ static void sigchld_handler(int signo AT
 				   process->seen_fatal) {
 				/* the error was already logged. */
 			} else {
-				msg = get_exit_status_message(status);
+				msg = get_exit_status_message(status,
+							      process_type);
 				msg = msg == NULL ? "" :
 					t_strconcat(" (", msg, ")", NULL);
 				i_error("child %s (%s) returned error %d%s",


More information about the dovecot-cvs mailing list