]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proxy: implement persistent named defaults
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Dec 2025 17:09:13 +0000 (18:09 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 Jan 2026 17:06:42 +0000 (18:06 +0100)
commitb52c60d3665ac8b3acf0db5f91503ba9d84c6725
treeee86c4e3833e1a6fc8bfab850c2181b32a1e3ed6
parent116983ad94c8c528ff46c59f78f4a6beb055aa18
MEDIUM: proxy: implement persistent named defaults

This patch changes the handling of named defaults sections. Prior to
this patch, every unreferenced defaults proxies were removed on post
parsing. Now by default, these sections are kept after postparsing and
only purged on deinit. The objective is to allow reusing them as base
configuration for dynamic backends.

To implement this, refcount of every still addressable named sections is
incremented by one after parsing. This ensures that they won't be
removed even if referencing proxies are removed at runtime. This is done
via the new function proxy_ref_all_defaults().

To ensure defaults instances are still properly removed on deinit, the
inverse operation is performed : refcount is decremented by one on every
defaults sections via proxy_unref_all_defaults().

The original behavior can still be used by using the new global keyword
tune.defaults.purge. This is useful for users using configuration with
large number of defaults and not interested in dynamic backends
creation.
doc/configuration.txt
include/haproxy/global-t.h
include/haproxy/proxy.h
src/cfgparse-global.c
src/haproxy.c
src/proxy.c