]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: server: postpone address resolution
authorBaptiste Assmann <bedis9@gmail.com>
Wed, 2 Nov 2016 14:34:05 +0000 (15:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 13:24:20 +0000 (14:24 +0100)
commit83cbaa531fb7c57b34bb5ba655cae38ca2ba4e14
tree18f7e54570f8562ca641c025bd5f72dea8ce49d6
parent4215d7d0336b40e934bb30f4524d4bbe58a8a5f6
MAJOR: server: postpone address resolution

Server addresses are not resolved anymore upon the first pass so that we
don't fail if an address cannot be resolved by the libc. Instead they are
processed all at once after the configuration is fully loaded, by the new
function srv_init_addr(). This function only acts on the server's address
if this address uses an FQDN, which appears in server->hostname.

For now the function does two things, to followup with HAProxy's historical
default behavior:

  1. apply server IP address found in server-state file if runtime DNS
     resolution is enabled for this server

  2. use the DNS resolver provided by the libc

If none of the 2 options above can find an IP address, then an error is
returned.

All of this will be needed to support the new server parameter "init-addr".
For now, the biggest user-visible change is that all server resolution errors
are dumped at once instead of causing a startup failure one by one.
include/proto/server.h
include/types/server.h
src/haproxy.c
src/server.c