Skip to content

Commit

Permalink
director: Fix rapid reconnection on failed outgoing connections
Browse files Browse the repository at this point in the history
last_network_failure wasn't set, which caused a failed outgoing connection
to immediately reconnect to it. This resulted in rapid logging of
connect() errors.
  • Loading branch information
sirainen committed Aug 18, 2017
1 parent f784d5b commit 1707f8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/director/director-connection.c
Expand Up @@ -2167,7 +2167,8 @@ static void director_connection_disconnected(struct director_connection **_conn,
struct director_connection *conn = *_conn;
struct director *dir = conn->dir;

if (conn->connected_time.tv_sec + DIRECTOR_SUCCESS_MIN_CONNECT_SECS > ioloop_time &&
if ((conn->connected_time.tv_sec == 0 ||
conn->connected_time.tv_sec + DIRECTOR_SUCCESS_MIN_CONNECT_SECS > ioloop_time) &&
conn->host != NULL) {
/* connection didn't exist for very long, assume it has a
network problem */
Expand Down

0 comments on commit 1707f8b

Please sign in to comment.