Skip to content

Commit

Permalink
dict: Pipelined iteration replies may have been hanging.
Browse files Browse the repository at this point in the history
For example:
 - lookup start
 - iterate start
 - iterate finished, but can't reply yet
 - lookup finished
 - iterate reply can be sent now, but wasn't previously
  • Loading branch information
sirainen committed Jun 2, 2016
1 parent 72f0027 commit 8b895d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dict/dict-commands.c
Expand Up @@ -34,6 +34,8 @@ struct dict_connection_cmd {

struct dict_command_stats cmd_stats;

static int cmd_iterate_flush(struct dict_connection_cmd *cmd);

static void dict_connection_cmd_output_more(struct dict_connection_cmd *cmd);

static void dict_connection_cmd_free(struct dict_connection_cmd *cmd)
Expand Down Expand Up @@ -72,6 +74,10 @@ static void dict_connection_cmds_flush(struct dict_connection *conn)
first_cmdp = array_idx(&conn->cmds, 0);
cmd = *first_cmdp;

/* we may be able to start outputting iterations now. */
if (cmd->iter != NULL)
(void)cmd_iterate_flush(cmd);

if (cmd->reply == NULL) {
/* command not finished yet */
break;
Expand Down

0 comments on commit 8b895d0

Please sign in to comment.