[PATCH 5 of 5] Adjusted logging level of ENOENT connect() errors

Maxim Dounin mdounin at mdounin.ru
Fri Mar 1 03:18:21 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1709260951 -10800
#      Fri Mar 01 05:42:31 2024 +0300
# Node ID c363ad6b3b23ae7fed28a7cdfa20b0cb3fc6a584
# Parent  37ef53ecd6b09d37b41d29a02e19b63e9d643994
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".

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