]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: server/checks: Init server check during config validity check
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 26 Mar 2020 18:48:20 +0000 (19:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
commit8892e5d30b2c20fce04f2f44202bc1f127076c15
treee6dd2f2480a07ca3f8a9e14d5bf38ae9145cd6bf
parentf61f33a1b274c2a42afd96aab19ee8e1d8b121cc
BUG/MEDIUM: server/checks: Init server check during config validity check

The options and directives related to the configuration of checks in a backend
may be defined after the servers declarations. So, initialization of the check
of each server must not be performed during configuration parsing, because some
info may be missing. Instead, it must be done during the configuration validity
check.

Thus, callback functions are registered to be called for each server after the
config validity check, one for the server check and another one for the server
agent-check. In addition deinit callback functions are also registered to
release these checks.

This patch should be backported as far as 1.7. But per-server post_check
callback functions are only supported since the 2.1. And the initcall mechanism
does not exist before the 1.9. Finally, in 1.7, the code is totally
different. So the backport will be harder on older versions.
src/cfgparse.c
src/checks.c
src/haproxy.c
src/server.c
src/ssl_sock.c