Mercurial > dovecot > core-2.2
changeset 20545:0be59f9f40ab
dict-client: Improved timeout error message
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 25 Jul 2016 17:08:18 -0400 |
parents | 88b0b65c732b |
children | e8b44e9197e2 |
files | src/lib-dict/dict-client.c |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-dict/dict-client.c Tue Aug 02 01:02:59 2016 +0300 +++ b/src/lib-dict/dict-client.c Mon Jul 25 17:08:18 2016 -0400 @@ -185,11 +185,19 @@ 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