]> git.kaiwu.me - haproxy.git/commit
MEDIUM: proxy: do not select a backend if disabled
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Jan 2026 09:45:40 +0000 (10:45 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 15 Jan 2026 08:08:18 +0000 (09:08 +0100)
commit21fb0a3f58a9835a184a02669134a0adf42b2298
treefad3f55d0f7f2cdb51ffff1f551991a32fa9793c
parent2d26d353ceaca7878bb222684e5d1d144a95d1f5
MEDIUM: proxy: do not select a backend if disabled

A proxy can be marked as disabled using the keyword with the same name.
The doc mentions that it won't process any traffic. However, this is not
really the case for backends as they may still be selected via switching
rules during stream processing.

In fact, currently access to disabled backends will be conducted up to
assign_server(). However, no eligible server is found at this stage,
resulting in a connection closure or an HTTP 503, which is expected. So
in the end, servers in disabled backends won't receive any traffic. But
this is only because post-parsing steps are not performed on such
backends. Thus, this can be considered as functional but only via
side-effects.

This patch clarifies the handling of disable backends, so that they are
never selected via switching rules. Now, process_switching_rules() will
ignore disable backends and continue rules evaluation.

As this is a behavior change, this patch is labelled as medium. The
documentation manuel for use_backend is updated accordingly.
doc/configuration.txt
include/haproxy/backend.h
reg-tests/stream/test_content_switching.vtc
src/stream.c