]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server: add init-state
authorAaron Kuehler <aaron.kuehler@powerhrg.com>
Wed, 4 Sep 2024 22:27:35 +0000 (18:27 -0400)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Sep 2024 09:13:10 +0000 (11:13 +0200)
commit50322dff81f3c05e67bf311ff9ef0c77c833df97
tree9d6ade25a41c3ff1703ec6b7472c7ba19756e5eb
parente8b1ad4c2b3985eb9e826fd279e419719a2c03ce
MEDIUM: server: add init-state

Allow the user to set the "initial state" of a server.

Context:

Servers are always set in an UP status by default. In
some cases, further checks are required to determine if the server is
ready to receive client traffic.

This introduces the "init-state {up|down}" configuration parameter to
the server.

- when set to 'fully-up', the server is considered immediately available
  and can turn to the DOWN sate when ALL health checks fail.
- when set to 'up' (the default), the server is considered immediately
  available and will initiate a health check that can turn it to the DOWN
  state immediately if it fails.
- when set to 'down', the server initially is considered unavailable and
  will initiate a health check that can turn it to the UP state immediately
  if it succeeds.
- when set to 'fully-down', the server is initially considered unavailable
  and can turn to the UP state when ALL health checks succeed.

The server's init-state is considered when the HAProxy instance
is (re)started, a new server is detected (for example via service
discovery / DNS resolution), a server exits maintenance, etc.

Link: https://github.com/haproxy/haproxy/issues/51
doc/configuration.txt
include/haproxy/server-t.h
src/server.c