]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: limits: properly account for global.maxpipes in compute_ideal_maxconn()
authorWilly Tarreau <w@1wt.eu>
Tue, 19 May 2026 13:05:52 +0000 (15:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 19 May 2026 13:19:23 +0000 (15:19 +0200)
Starting a config with maxpipes and no maxconn always ended up in error
because the number of FDs needed for pipes was not deduced from the total
number of FDs when calculating maxconn, and was later found to exceed the
total number of allocatable FD during final checks.

When global.maxpipes is set, it must be used during compute_ideal_maxconn()
so that it's properly deduced.

Without this, just having "maxpipes 500" in a config prevents it from
starting. With the fix, it properly starts with a maxconn adjusted
depending on the number of splice-enabled proxies.

This should be backported, theoretically everywhere, but preferably
progressively. The following config should fail on affected versions
and load with fixed ones:

   global
        maxpipes 500

   frontend srv1
        bind :8001

src/limits.c

index 6587ee9b7983bd34f3a4ba8238fe686dc85d2217..fcd92975244c3f853544f73e0d327242f462c4ac 100644 (file)
@@ -116,7 +116,7 @@ static int compute_ideal_maxconn()
 {
        int ssl_sides = !!global.ssl_used_frontend + !!global.ssl_used_backend;
        int engine_fds = global.ssl_used_async_engines * ssl_sides;
-       int pipes = compute_ideal_maxpipes();
+       int pipes = global.maxpipes ? global.maxpipes : compute_ideal_maxpipes();
        int remain = MAX(rlim_fd_cur_at_boot, rlim_fd_max_at_boot);
        int maxconn;