dovecot-2.2: stats: Hide warnings about old autocreated sessions...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 23 16:23:34 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/25f6fbeff5d9
changeset: 16874:25f6fbeff5d9
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 23 16:23:23 2013 +0300
description:
stats: Hide warnings about old autocreated sessions having gotten lost.

diffstat:

 src/stats/mail-session.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 459ec8f7ac96 -r 25f6fbeff5d9 src/stats/mail-session.c
--- a/src/stats/mail-session.c	Wed Oct 23 16:10:30 2013 +0300
+++ b/src/stats/mail-session.c	Wed Oct 23 16:23:23 2013 +0300
@@ -48,10 +48,17 @@
 
 static void mail_session_idle_timeout(struct mail_session *session)
 {
-	i_warning("Session %s (user %s, service %s) appears to have crashed, "
-		  "disconnecting it",
-		  guid_128_to_string(session->guid), session->user->name,
-		  session->service);
+	/* user="" service="" pid=0 is used for incoming sessions that were
+	   received after we detected a stats process crash/restart. there's
+	   no point in logging anything about them, since they contain no
+	   useful information. */
+	if (session->user->name[0] == '\0' && session->service[0] != '\0' &&
+	    session->pid == 0) {
+		i_warning("Session %s (user %s, service %s) "
+			  "appears to have crashed, disconnecting it",
+			  guid_128_to_string(session->guid),
+			  session->user->name, session->service);
+	}
 	mail_session_disconnect(session);
 }
 


More information about the dovecot-cvs mailing list