]> 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)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 16 Nov 2017 08:52:33 +0000 (10:52 +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 9a64bf25f6bc3dda48d0b98b0adf0ef06b0a7482..fa530aff3a3b301210a7fd9025be1706ea63d086 100644 (file)
@@ -2305,7 +2305,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,