dovecot-2.2: director: Don't send DIRECTOR command infinitely in...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 13 02:27:35 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/b7aed6290e7e
changeset: 18665:b7aed6290e7e
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 13 05:22:22 2015 +0300
description:
director: Don't send DIRECTOR command infinitely in loop if that director got disconnected.

diffstat:

 src/director/director-connection.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 502755a1af5f -r b7aed6290e7e src/director/director-connection.c
--- a/src/director/director-connection.c	Wed May 13 04:11:34 2015 +0300
+++ b/src/director/director-connection.c	Wed May 13 05:22:22 2015 +0300
@@ -670,8 +670,18 @@
 	   itself. some hosts may see this twice, but that's the only way to
 	   guarantee that it gets seen by everyone. reseting the host multiple
 	   times may cause us to handle its commands multiple times, but the
-	   commands can handle that. */
-	director_notify_ring_added(host, director_connection_get_host(conn));
+	   commands can handle that. however, we need to also handle a
+	   situation where the added director never comes back - we don't want
+	   to send the director information in a loop forever. */
+	if (conn->dir->right != NULL &&
+	    director_host_cmp_to_self(host, conn->dir->right->host,
+				      conn->dir->self_host) > 0) {
+		dir_debug("Received DIRECTOR update for a host where we should be connected to. "
+			  "Not forwarding it since it's probably crashed.");
+	} else {
+		director_notify_ring_added(host,
+			director_connection_get_host(conn));
+	}
 	return TRUE;
 }
 


More information about the dovecot-cvs mailing list