]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: proxy: convert server list to a doubly linked struct list
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Jul 2026 13:01:59 +0000 (15:01 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 Jul 2026 07:33:31 +0000 (09:33 +0200)
commit81fc22033596b615c30b752a68a0bf22a7c52bd8
treefeb937d565c24b82626309a993a8af2971fca03e
parentb679ccb76021a39f495f652d60634ab95cb68871
MAJOR: proxy: convert server list to a doubly linked struct list

Servers are stored in a list in their parent proxy. Prior to this patch,
this list was singly linked.

This patch converts the proxy server list to a doubly linked struct
list. Server <next> pointer is replaced by a struct list <el_px> attach
point.

The main benefit from this patch is that it removes the bottleneck
performance for add and delete server operations at runtime. As with
main proxies list conversion, this is labelled as major as it is an API
change.

Most of the changes are straightforward : for/while statements are
replaced by list_for_each_entry() macros. LIST_ISEMPTY() is now used to
detect if a proxy does not contain any server.

Server insertion at the front position during config parsing is kept at
the moment, with reordering on post parsing. With the current patch,
this is not strictly necessary so this will be removed in a next change.
27 files changed:
addons/promex/service-prometheus.c
include/haproxy/proxy-t.h
include/haproxy/proxy.h
include/haproxy/server-t.h
include/haproxy/server.h
src/backend.c
src/cfgdiag.c
src/check.c
src/fcgi-app.c
src/flt_spoe.c
src/haproxy.c
src/http_client.c
src/lb_chash.c
src/lb_fas.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c
src/lb_ss.c
src/log.c
src/proxy.c
src/resolvers.c
src/server.c
src/server_state.c
src/sink.c
src/stats-html.c
src/stats-proxy.c
src/stats.c