From 8b895d07ddd7044050267a5db3b1272183152307 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 2 Jun 2016 00:52:37 +0300 Subject: [PATCH] dict: Pipelined iteration replies may have been hanging. 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 --- src/dict/dict-commands.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dict/dict-commands.c b/src/dict/dict-commands.c index 45078144ca..7c19f468ea 100644 --- a/src/dict/dict-commands.c +++ b/src/dict/dict-commands.c @@ -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) @@ -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;