From 128216edbfb4bbf58cbabd0c77e78c87c2c47407 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 30 Mar 2016 08:24:51 +0300 Subject: [PATCH] director: Avoid a potential assert-crash after removing a director from ring. This should fix the crash: Panic: director: file director-connection.c: line 1926 (director_connection_init_out): assertion failed: (!host->removed) Also moved the last_network_failure timestamp reset a bit later, since there's no need to reset the timestamp if we're not actually connecting to the server. --- src/director/director-connection.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 9c058f2150..a727658efd 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -1472,8 +1472,6 @@ static bool director_cmd_connect(struct director_connection *conn, } host = director_host_get(conn->dir, &ip, port); - /* reset failure timestamp so we'll actually try to connect there. */ - host->last_network_failure = 0; /* remote suggests us to connect elsewhere */ if (dir->right != NULL && @@ -1485,6 +1483,11 @@ static bool director_cmd_connect(struct director_connection *conn, return TRUE; } + /* reset failure timestamp so we'll actually try to connect there. */ + host->last_network_failure = 0; + /* reset removed-flag, so we don't crash */ + host->removed = FALSE; + if (dir->right == NULL) { dir_debug("Received CONNECT request to %s, " "initializing right", host->name); -- 2.47.3