]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Don't reset directors' last_network_failure while handshaking
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 14 Sep 2017 14:38:24 +0000 (17:38 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 Oct 2017 14:45:38 +0000 (17:45 +0300)
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.

src/director/director-connection.c

index 0b0e483c30c22304a17cfda7d1f4fcfb82b400e3..97232b9a6805a4ea399d94788188125622f5773c 100644 (file)
@@ -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 {