dovecot-2.2: stats plugin: Don't try to send notifications to al...

dovecot at dovecot.org dovecot at dovecot.org
Tue Apr 23 21:32:44 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/83d83f55e5c2
changeset: 16320:83d83f55e5c2
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 23 21:32:24 2013 +0300
description:
stats plugin: Don't try to send notifications to already dead stats process.

diffstat:

 src/plugins/stats/Makefile.am        |  1 +
 src/plugins/stats/stats-connection.c |  7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r b8be0d35228e -r 83d83f55e5c2 src/plugins/stats/Makefile.am
--- a/src/plugins/stats/Makefile.am	Tue Apr 23 21:31:52 2013 +0300
+++ b/src/plugins/stats/Makefile.am	Tue Apr 23 21:32:24 2013 +0300
@@ -2,6 +2,7 @@
 	-I$(top_srcdir)/src/lib \
 	-I$(top_srcdir)/src/lib-settings \
 	-I$(top_srcdir)/src/lib-mail \
+	-I$(top_srcdir)/src/lib-master \
 	-I$(top_srcdir)/src/lib-index \
 	-I$(top_srcdir)/src/lib-storage
 
diff -r b8be0d35228e -r 83d83f55e5c2 src/plugins/stats/stats-connection.c
--- a/src/plugins/stats/stats-connection.c	Tue Apr 23 21:31:52 2013 +0300
+++ b/src/plugins/stats/stats-connection.c	Tue Apr 23 21:32:24 2013 +0300
@@ -5,6 +5,7 @@
 #include "net.h"
 #include "str.h"
 #include "strescape.h"
+#include "master-service.h"
 #include "mail-storage.h"
 #include "stats-plugin.h"
 #include "stats-connection.h"
@@ -71,6 +72,12 @@
 	static bool pipe_warned = FALSE;
 	ssize_t ret;
 
+	/* if master process has been stopped (and restarted), don't even try
+	   to notify the stats process anymore. even if one exists, it doesn't
+	   know about us. */
+	if (master_service_is_master_stopped(master_service))
+		return;
+
 	if (conn->fd == -1) {
 		if (!stats_connection_open(conn))
 			return;


More information about the dovecot-cvs mailing list