]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-client: Improved timeout error message
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 25 Jul 2016 21:08:18 +0000 (17:08 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 1 Aug 2016 22:03:58 +0000 (01:03 +0300)
src/lib-dict/dict-client.c

index f186d6254f21ca191739e09e7f689a99f0019d89..f4ba7f3c0f0497c5d92629f59f7b391123faf92c 100644 (file)
@@ -185,11 +185,19 @@ dict_cmd_callback_error(struct client_dict_cmd *cmd, const char *error,
 
 static void client_dict_input_timeout(struct client_dict *dict)
 {
-       int diff = timeval_diff_msecs(&ioloop_timeval, &dict->last_input);
+       struct client_dict_cmd *const *cmds;
+       unsigned int count;
+
+       cmds = array_get(&dict->cmds, &count);
+       i_assert(count > 0);
 
+       int input_diff = timeval_diff_msecs(&ioloop_timeval, &dict->last_input);
+       int cmd_diff = timeval_diff_msecs(&ioloop_timeval, &cmds[0]->start_time);
        client_dict_disconnect(dict, t_strdup_printf(
-               "Timeout: No input from dict for %u.%03u secs",
-               diff/1000, diff%1000));
+               "Timeout: No input from dict for %u.%03u secs "
+               "(%u commands pending, oldest sent %u.%03u secs ago: %s)",
+               input_diff/1000, input_diff%1000, count,
+               cmd_diff/1000, cmd_diff%1000, cmds[0]->query));
 }
 
 static int