aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2017-09-12 13:44:04 +0300
committerRoman Arutyunyan <arut@nginx.com>2017-09-12 13:44:04 +0300
commitc36a3c0cba7082f4b4933e90eef986e49e3eea98 (patch)
tree869a7a798131713e0327e37ad2f38b6d84c23486
parentb900cc28fcbb4cf5a32ab62f80b59292e1c85b4b (diff)
downloadnginx-c36a3c0cba7082f4b4933e90eef986e49e3eea98.tar.gz
nginx-c36a3c0cba7082f4b4933e90eef986e49e3eea98.zip
Stream: fixed logging UDP upstream timeout.
Previously, when the first UDP response packet was not received from the proxied server within proxy_timeout, no error message was logged before switching to the next upstream. Additionally, when one of succeeding response packets was not received within the timeout, the timeout error had low severity because it was logged as a client connection error as opposed to upstream connection error.
-rw-r--r--src/stream/ngx_stream_proxy_module.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index 395e0f650..9d4b075fb 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -1331,13 +1331,17 @@ ngx_stream_proxy_process_connection(ngx_event_t *ev, ngx_uint_t from_upstream)
return;
}
+ ngx_connection_error(pc, NGX_ETIMEDOUT, "upstream timed out");
+
if (u->received == 0) {
ngx_stream_proxy_next_upstream(s);
return;
}
+
+ } else {
+ ngx_connection_error(c, NGX_ETIMEDOUT, "connection timed out");
}
- ngx_connection_error(c, NGX_ETIMEDOUT, "connection timed out");
ngx_stream_proxy_finalize(s, NGX_STREAM_OK);
return;
}