From: Timo Sirainen Date: Mon, 25 Jul 2016 21:08:18 +0000 (-0400) Subject: dict-client: Improved timeout error message X-Git-Tag: 2.3.0.rc1~3280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0fa29db7def334c142f46507a7d0c0bd6c70932;p=thirdparty%2Fdovecot%2Fcore.git dict-client: Improved timeout error message --- diff --git a/src/lib-dict/dict-client.c b/src/lib-dict/dict-client.c index f186d6254f..f4ba7f3c0f 100644 --- a/src/lib-dict/dict-client.c +++ b/src/lib-dict/dict-client.c @@ -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