Mercurial > dovecot > core-2.2
changeset 16320:83d83f55e5c2
stats plugin: Don't try to send notifications to already dead stats process.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 23 Apr 2013 21:32:24 +0300 |
parents | b8be0d35228e |
children | 73d67860db85 |
files | src/plugins/stats/Makefile.am src/plugins/stats/stats-connection.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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;