dovecot-2.2: director: Improved debug logging about connecting t...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 13 01:13:34 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/f43adca71e15
changeset: 18661:f43adca71e15
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 13 04:07:46 2015 +0300
description:
director: Improved debug logging about connecting to another director.

diffstat:

 src/director/director.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r e899171adc14 -r f43adca71e15 src/director/director.c
--- a/src/director/director.c	Wed May 13 00:33:18 2015 +0300
+++ b/src/director/director.c	Wed May 13 04:07:46 2015 +0300
@@ -109,8 +109,22 @@
 	if (director_has_outgoing_connection(dir, host))
 		return 0;
 
-	dir_debug("Connecting to %s:%u",
-		  net_ip2addr(&host->ip), host->port);
+	if (director_debug) {
+		string_t *str = t_str_new(128);
+
+		str_printfa(str, "Connecting to %s:%u (as %s",
+			    net_ip2addr(&host->ip), host->port,
+			    net_ip2addr(&dir->self_ip));
+		if (host->last_network_failure > 0) {
+			str_printfa(str, ", last network failure %ds ago",
+				    (int)(ioloop_time - host->last_network_failure));
+		}
+		if (host->last_protocol_failure > 0) {
+			str_printfa(str, ", last protocol failure %ds ago",
+				    (int)(ioloop_time - host->last_protocol_failure));
+		}
+		dir_debug("%s", str_c(str));
+	}
 	port = dir->test_port != 0 ? dir->test_port : host->port;
 	fd = net_connect_ip(&host->ip, port, &dir->self_ip);
 	if (fd == -1) {


More information about the dovecot-cvs mailing list