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 committed Jul 4, 2018
1 parent b25bce8 commit c058391
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/director/doveadm-connection.c
Expand Up @@ -1068,8 +1068,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 c058391

Please sign in to comment.