]> git.kaiwu.me - haproxy.git/commitdiff
MEDIUM: servers: Do not allow reverse HTTP with per-tg fd tables
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 28 Aug 2026 13:54:09 +0000 (15:54 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 28 Aug 2026 14:07:52 +0000 (16:07 +0200)
We can't steal the connection of other thread groups with per-thread
group file descriptor tables, so disallow its usage if there's a server
that uses reverse HTTP, as requests could fail because we would not have
enough connections.

src/proxy.c

index 85cc966673091a30ead63bdc7eb7e4ce7d62f1a8..d08cbd0d981ddd33b3cced327b3bc5c29867c9e3 100644 (file)
@@ -2767,12 +2767,22 @@ int proxy_finalize(struct proxy *px, int *err_code)
                if (px->mode == PR_MODE_SPOP)
                        px->options |= PR_O_REUSE_ALWS;
 
-               if ((px->mode != PR_MODE_HTTP) && newsrv->flags & SRV_F_RHTTP) {
-                       ha_alert("%s '%s' : server %s uses reverse HTTP addressing which can only be used with HTTP mode.\n",
-                                proxy_type_str(px), px->id, newsrv->id);
-                       cfgerr++;
-                       *err_code |= ERR_FATAL | ERR_ALERT;
-                       goto out;
+               if (newsrv->flags & SRV_F_RHTTP) {
+                       if ((global.tune.options & GTUNE_NO_TG_FD_SHARING) &&
+                           (global.nbtgroups > 1)) {
+                               ha_alert("%s '%s' : server %s uses reverse HTTP addressing which is incompatible with tune.fd.tables per-thread-group.\n",
+                                        proxy_type_str(px), px->id, newsrv->id);
+                               cfgerr++;
+                               *err_code |= ERR_FATAL | ERR_ALERT;
+                               goto out;
+                       }
+                       if (px->mode != PR_MODE_HTTP) {
+                               ha_alert("%s '%s' : server %s uses reverse HTTP addressing which can only be used with HTTP mode.\n",
+                                        proxy_type_str(px), px->id, newsrv->id);
+                               cfgerr++;
+                               *err_code |= ERR_FATAL | ERR_ALERT;
+                               goto out;
+                       }
                }
        }