]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: spoe: force "always" reuse policy when converting SPOP backend
authorMarcWort <113890636+MarcWort@users.noreply.github.com>
Mon, 30 Nov 2026 07:37:21 +0000 (08:37 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Nov 2026 15:03:42 +0000 (16:03 +0100)
When an SPOE agent uses a backend declared in "mode tcp", the backend is
automatically converted to "mode spop" during configuration validation.
The conversion is done in spoe_check(), which is called from flt_check(),
i.e. after proxy_finalize() has already normalized the mode-dependent
options of that backend. Seeing the backend was still in TCP mode at the
time, its http-reuse policy was stripped down to "never", while explicit
"mode spop" backends are unconditionally forced to "always".

Fix this by forcing PR_O_REUSE_ALWS (after clearing the reuse bits) when
the backend is converted to SPOP mode, which is exactly the policy an
explicit "mode spop" backend ends up with in proxy_finalize().

This patch should fix the issue #3611. It should to be backported as far as
3.2.

src/flt_spoe.c

index d9072f4cb39411fef5df30e2d8bbd6562797e3fa..f79f663379b64a69e09cce337779e7161ab1ae9c 100644 (file)
@@ -1378,8 +1378,10 @@ static int spoe_check(struct proxy *px, struct flt_conf *fconf)
                return 1;
        }
        if (target->mode == PR_MODE_TCP) {
-               /* Convert legacy SPOP backend by added the right mode */
+               /* Convert legacy SPOP backend by setting the right mode and features */
                target->mode = PR_MODE_SPOP;
+               target->options &= ~PR_O_REUSE_MASK;
+               target->options |= PR_O_REUSE_ALWS;
        }
        if (target->mode != PR_MODE_SPOP) {
                ha_alert("Proxy %s : backend '%s' used by SPOE agent '%s' declared"