forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Sanitize hostnames resolving on start" from Pavel E
" On start scylla resolves several hostnames into addresses. Different places use different hostname selection logic, e.g. the API address can be the listen one if the dedicated option not set. Failure to resolve a hostname is reported with an exception that (sometimes) contains the hostname, but it doesn't look very convenient -- better to know the config option name. Also resolving of different hostnames has different decoration around, e.g. prometheus carries a main-local lambda just to nicely wrap the try/catch block. This set unifies this zoo and makes main() shorter and less hairy: 1. All failures to resolve a hostname are reported with an exception containing the relevant config option 2. The || operator for named_value's is introduced to make the option selection look as short as resolve(cfg->some_address() || cfg->another_address()) 3. All sanity checks are explicit and happen early in main 4. No dangling local variables carrying the cfg->...() value 5. Use resolved IP when logging a "... is listening on ..." message after a service start tests: unit(dev) " * 'br-ip-resolve-on-start' of https://github.com/xemul/scylla: main: Move fb-utilities initialization up the main code: Use utils::resolve instead of inet_address::lookup main: Remove unused variable main: Sanitize resolving of listen address main: Sanitize resolving of broadcast address main: Sanitize resolving of broadcast RPC address main: Sanitize resolving of API address main: Sanitize resolving of prometheus address utils: Introduce || operator for named_values db.config: Verbose address resolver helper main: Remove api-port and prometheus-port variables alternator: Resolve address with the help of inet_address redis, thrift: Remove unused captures
- Loading branch information
Showing
9 changed files
with
63 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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