changeset 19608:01e33753b08e

director: "Host is being updated before previous update had finished" logs now details.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Fri, 22 Jan 2016 19:08:11 +0200
parents de55cde023c4
children e7e593e68fce
files src/director/director-connection.c
diffstat 1 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/director-connection.c	Fri Jan 22 15:15:03 2016 +0000
+++ b/src/director/director-connection.c	Fri Jan 22 19:08:11 2016 +0200
@@ -916,6 +916,24 @@
 			update = TRUE;
 		}
 		if (update && host->desynced) {
+			string_t *str = t_str_new(128);
+
+			str_printfa(str, "director(%s): Host %s is being updated before previous update had finished (",
+				  conn->name, net_ip2addr(&host->ip));
+			if (host->down != down) {
+				if (host->down)
+					str_append(str, "down -> up");
+				else
+					str_append(str, "up -> down");
+			}
+			if (host->vhost_count != vhost_count) {
+				if (host->down != down)
+					str_append(str, ", ");
+				str_printfa(str, "vhosts %u -> %u",
+					    host->vhost_count, vhost_count);
+			}
+			str_append(str, ") - ");
+
 			vhost_count = I_MIN(vhost_count, host->vhost_count);
 			if (host->down != down) {
 				if (host->last_updown_change <= last_updown_change)
@@ -923,10 +941,9 @@
 			}
 			last_updown_change = I_MAX(last_updown_change,
 						   host->last_updown_change);
-			i_warning("director(%s): Host %s is being updated before previous update had finished - "
-				  "setting to state=%s vhosts=%u",
-				  conn->name, net_ip2addr(&host->ip),
-				  down ? "down" : "up", vhost_count);
+			str_printfa(str, "setting to state=%s vhosts=%u",
+				    down ? "down" : "up", vhost_count);
+			i_warning("%s", str_c(str));
 			/* make the change appear to come from us, so it
 			   reaches the full ring */
 			dir_host = NULL;