[nginx] Adjusted logging level of ENOENT connect() errors.

Maxim Dounin mdounin at mdounin.ru
Wed Mar 13 15:52:32 UTC 2024


details:   http://freenginx.org/hg/nginx/rev/c363ad6b3b23
branches:  
changeset: 9228:c363ad6b3b23
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Fri Mar 01 05:42:31 2024 +0300
description:
Adjusted logging level of ENOENT connect() errors.

Connecting to unix sockets might legitimately return ENOENT if the socket
does not exists.  Changed logging level of such errors from the default
one for unknown errors, "crit", to "error".

diffstat:

 src/core/ngx_resolver.c       |  3 ++-
 src/event/ngx_event_connect.c |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (26 lines):

diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -4625,7 +4625,8 @@ ngx_tcp_connect(ngx_resolver_connection_
                 || err == NGX_ENETDOWN
                 || err == NGX_ENETUNREACH
                 || err == NGX_EHOSTDOWN
-                || err == NGX_EHOSTUNREACH)
+                || err == NGX_EHOSTUNREACH
+                || err == NGX_ENOENT)
             {
                 level = NGX_LOG_ERR;
 
diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c
--- a/src/event/ngx_event_connect.c
+++ b/src/event/ngx_event_connect.c
@@ -231,7 +231,8 @@ ngx_event_connect_peer(ngx_peer_connecti
                 || err == NGX_ENETDOWN
                 || err == NGX_ENETUNREACH
                 || err == NGX_EHOSTDOWN
-                || err == NGX_EHOSTUNREACH)
+                || err == NGX_EHOSTUNREACH
+                || err == NGX_ENOENT)
             {
                 level = NGX_LOG_ERR;
 



More information about the nginx-devel mailing list