rust: support and default to --host localhost
#4804
Merged
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.
Summary:
We now interpret
--host
as a string that can begetaddrinfo
d ratherthan requiring it to be a literal IP address. Thus, we can support
hostnames like
localhost
that may have multiple resolutions:Thus, we change the default
--host
from::1
tolocalhost
tosupport systems where
::1
may not be available. Should fix #4801.We also improve the error message on bind failure: it’s pretty-printed
instead of
Debug
-formatted, and it includes the problematic address.Test Plan:
From
tensorboard/data/server/
, runcargo build
, then reproduce thefailure in Docker:
…then try again with default
--host
and note that it works:(You may need to
docker kill $(docker ps -q)
the thing afterward.)wchargin-branch: rust-host-getaddrinfo