Skip to content

Commit

Permalink
director: Add assert to make sure doveadm connection's IO isn't added…
Browse files Browse the repository at this point in the history
… multiple times
  • Loading branch information
sirainen authored and cmouse committed Sep 20, 2018
1 parent 65d75c8 commit 12d46e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/director/doveadm-connection.c
Expand Up @@ -951,6 +951,7 @@ doveadm_connection_ring_sync_timeout(struct doveadm_connection *conn)
doveadm_connection_ring_sync_list_move(conn);
o_stream_nsend_str(conn->output, "Ring sync timed out\n");

i_assert(conn->io == NULL);
doveadm_connection_set_io(conn);
io_set_pending(conn->io);

Expand Down Expand Up @@ -1171,6 +1172,10 @@ static void doveadm_connections_continue_reset_cmds(void)

void doveadm_connections_ring_synced(struct director *dir)
{
/* Note that it's not possible for a single connection to be multiple
times in doveadm_ring_sync_pending_connections. This is prevented
by removing input IO from the connection whenever it's added to the
list. */
while (doveadm_ring_sync_pending_connections != NULL &&
dir->ring_synced) {
struct doveadm_connection *conn =
Expand Down

0 comments on commit 12d46e7

Please sign in to comment.