Repository navigation
feat(config): resolve backend host names when the file is loaded - #1895
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 15, 2026 14:59
FlorentinDUBOIS
marked this pull request as draft
October 15, 2026 15:36
Closes #347 Signed-off-by: Florentin Dubois <[email protected]>
Closes #347 Signed-off-by: Florentin Dubois <[email protected]>
Closes #347 Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
marked this pull request as ready for review
October 15, 2026 17:11
Closes #347 Signed-off-by: Florentin Dubois <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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