diff src/stream/ngx_stream_proxy_module.c @ 7105:0846dd76a487

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.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 12 Sep 2017 13:44:04 +0300
parents 7bfbf73db920
children 9c29644f6d03
line wrap: on
line diff
--- 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_
                     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;
         }