Skip to content

feat(config): resolve backend host names when the file is loaded - #1895

Merged
FlorentinDUBOIS merged 5 commits into
mainfrom
feat/backend-dns-config
Oct 15, 2026
Merged

FlorentinDUBOIS merged 5 commits into
mainfrom
feat/backend-dns-config

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Resolve TOML backend host names once during startup, configuration checks and explicit file reload. Expand resolved addresses into deterministic backend identities; reject failed resolution and malformed numeric addresses. Passive control commands do not resolve backend DNS. Workers and protobuf messages retain resolved socket addresses.

Validation: configuration and control-command suites, deterministic expansion checks, and RED/GREEN cases for numeric IPv4 aliases and unbracketed IPv6. Independent public-source and final delta reviews approved the current head. The full GitHub Actions matrix must succeed before merge.

Closes #347

A backend `address` in the TOML configuration file may now be a
`host:port` as well as a socket address. The name is resolved once, with
`std::net::ToSocketAddrs`, when `FileClusterConfig::to_cluster_config`
builds the cluster, at startup or on `sozu reload --file`. It is never
re-resolved while running; a plain `sozu reload` replays the
configuration loaded at startup.

Each distinct resolved address, sorted, becomes a backend with a
deterministic id: `<backend_id>-<address>` when the entry sets one,
`<cluster_id>-<host:port>-<address>` otherwise. A configured `sticky_id`
is suffixed with `-<address>` when the name yields several addresses, so
sticky sessions do not all pin to the first one. A name that does not
resolve refuses the file with `ConfigError::BackendAddressResolution`,
naming the cluster and the entry.

Socket-address literals bypass the resolver and keep their ids, so a
file without a host name loads exactly as before. Workers, the command
channel and the protobuf schema are unchanged: they only ever see socket
addresses.

Closes #347

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS marked this pull request as ready for review October 15, 2026 14:59
@FlorentinDUBOIS
FlorentinDUBOIS marked this pull request as draft October 15, 2026 15:36
@FlorentinDUBOIS
FlorentinDUBOIS marked this pull request as ready for review October 15, 2026 17:11
@FlorentinDUBOIS
FlorentinDUBOIS merged commit 4597202 into main Oct 15, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add possibility to resolve domains in the backend definition

1 participant