Skip to content

Commit

Permalink
director: Fix assert-crash when doveadm disconnects immediately after…
Browse files Browse the repository at this point in the history
… sending command

Any command that requires a ring sync should cause the doveadm connection to
wait until the ring is synced. However, if the disconnection happened early
enough the connection is deinitialized before the ring sync is finished.

Fixes:
Panic: file doveadm-connection.c: line 1097 (doveadm_connection_deinit): assertion failed: (conn->to_ring_sync_abort == NULL)
  • Loading branch information
sirainen authored and villesavolainen committed Sep 24, 2018
1 parent d5ab2c0 commit 110d5f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/director/doveadm-connection.c
Expand Up @@ -1069,8 +1069,11 @@ static void doveadm_connection_input(struct doveadm_connection *conn)
ret = doveadm_connection_cmd(conn, line);
} T_END;
}
if (conn->input->eof || conn->input->stream_errno != 0 ||
ret == DOVEADM_DIRECTOR_CMD_RET_FAIL)
/* Delay deinit if io was removed, even if the client
already disconnected. */
if (conn->io != NULL &&
(conn->input->eof || conn->input->stream_errno != 0 ||
ret == DOVEADM_DIRECTOR_CMD_RET_FAIL))
doveadm_connection_deinit(&conn);
}

Expand Down

0 comments on commit 110d5f0

Please sign in to comment.