From: Timo Sirainen Date: Thu, 14 Sep 2017 14:38:24 +0000 (+0300) Subject: director: Don't reset directors' last_network_failure while handshaking X-Git-Tag: 2.3.0.rc1~1015 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e588e0b3f3119ba2cc98b338ee9868f8f0297f49;p=thirdparty%2Fdovecot%2Fcore.git director: Don't reset directors' last_network_failure while handshaking The reset is done mainly to make it faster for a director that has been down to connect back to the ring, without other directors still thinking that it's down. But DIRECTOR that is sent during handshake says nothing about whether the director is up at the moment or not. --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index dc0b898374..cfbe5dff3a 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -761,8 +761,12 @@ static bool director_cmd_director(struct director_connection *conn, } /* already have this. just reset its last_network_failure - timestamp, since it might be up now. */ - host->last_network_failure = 0; + timestamp, since it might be up now, but only if this + isn't part of the handshake. (if it was, reseting the + timestamp could cause us to rapidly keep trying to connect + to it) */ + if (conn->handshake_received) + host->last_network_failure = 0; /* it also may have been restarted, reset its state */ director_host_restarted(host); } else {