]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sock: adjust accept() error messages for ENFILE and ENOMEM
authorEgor Shestakov <egor@ved1.me>
Wed, 25 Feb 2026 16:52:33 +0000 (16:52 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Mar 2026 15:51:47 +0000 (16:51 +0100)
In the ENFILE and ENOMEM cases, when accept() fails, an irrelevant
global.maxsock value was printed that doesn't reflect system limits.
Now the actconn is printed that gives a hint about the failure reasons.

Should be backported in all stable branches.

src/sock.c

index c1e88413fc37414dd3912a25820e3249465274bc..5524d6617150dbfbafc58c0d6a384ead36852279 100644 (file)
@@ -162,8 +162,8 @@ struct connection *sock_accept_conn(struct listener *l, int *status)
        case ENFILE:
                if (p)
                        send_log(p, LOG_EMERG,
-                                "Proxy %s reached system FD limit (maxsock=%d). Please check system tunables.\n",
-                                p->id, global.maxsock);
+                                "Proxy %s reached system FD limit (actconn=%d). Please check system tunables.\n",
+                                p->id, actconn);
                ret = CO_AC_PAUSE;
                break;
 
@@ -179,8 +179,8 @@ struct connection *sock_accept_conn(struct listener *l, int *status)
        case ENOMEM:
                if (p)
                        send_log(p, LOG_EMERG,
-                                "Proxy %s reached system memory limit (maxsock=%d). Please check system tunables.\n",
-                                p->id, global.maxsock);
+                                "Proxy %s reached system memory limit (actconn=%d). Please check system tunables.\n",
+                                p->id, actconn);
                ret = CO_AC_PAUSE;
                break;