]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Reconnect after detecting a write failure to director
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 15 Nov 2017 22:44:17 +0000 (00:44 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 16 Nov 2017 10:15:35 +0000 (12:15 +0200)
If disconnection is detected during write failure, or "Output buffer full"
occurs, the connection is disconnected. However, if this was the right side
connection, it wasn't automatically reconnected to. This left the ring
nonworking.

src/director/director-connection.c

index 69839b0efd34788173d78265ac78937c6030b8cd..aacc58d964e81d8d869da7e93649083c085a72fb 100644 (file)
@@ -2312,7 +2312,11 @@ static void director_connection_reconnect(struct director_connection **_conn,
 
 static void director_disconnect_write_error(struct director_connection *conn)
 {
+       struct director *dir = conn->dir;
+
        director_connection_deinit(&conn, "write failure");
+       if (dir->right == NULL)
+               director_connect(dir, "Reconnecting after write failure");
 }
 
 void director_connection_send(struct director_connection *conn,