From: Timo Sirainen Date: Wed, 12 Mar 2014 10:26:09 +0000 (+0200) Subject: auth worker: Log a warning if master disconnects us while handling a long request. X-Git-Tag: 2.2.13.rc1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6bffcdf187c155dccc04fb4267b4f82ce59347d;p=thirdparty%2Fdovecot%2Fcore.git auth worker: Log a warning if master disconnects us while handling a long request. --- diff --git a/src/auth/auth-worker-client.c b/src/auth/auth-worker-client.c index ef5cc57ee2..ae782b088d 100644 --- a/src/auth/auth-worker-client.c +++ b/src/auth/auth-worker-client.c @@ -109,15 +109,19 @@ static void auth_worker_send_reply(struct auth_worker_client *client, string_t *str) { time_t cmd_duration = time(NULL) - client->cmd_start; + const char *p; if (worker_restart_request) o_stream_nsend_str(client->output, "RESTART\n"); o_stream_nsend(client->output, str_data(str), str_len(str)); if (o_stream_nfinish(client->output) < 0 && request != NULL && cmd_duration > AUTH_WORKER_WARN_DISCONNECTED_LONG_CMD_SECS) { + p = strchr(str_c(str), '\t'); + p = p == NULL ? "BUG" : t_strcut(p+1, '\t'); + i_warning("Auth master disconnected us while handling " - "request for %s for %ld secs", - request->user, (long)cmd_duration); + "request for %s for %ld secs (result=%s)", + request->user, (long)cmd_duration, p); } }