-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for late binding to IP addresses using go-sockaddr/template #2399
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a33af1c
Add support for late binding to IP addresses using go-sockaddr/template
multani 02af50f
Parse template before splitting host/port
multani a61b70b
Default to private IP advertise address in non-dev mode
multani 5fb0b30
Allow to advertise 127.0.0.1 in non-dev mode if explicitly configured
multani 544d9e9
Update doc to explain support for go-sockaddr/template format
multani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions
2
vendor/github.com/hashicorp/go-sockaddr/template/Makefile
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
vendor/github.com/hashicorp/go-sockaddr/template/README.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we don't want this to happen unless AdvertiseAddrs.RPC is explicitly set to localhost.
The reason is advertising localhost any time other than for a local test node can do Very Bad Things. The worst case scenario is having a server agent advertise localhost to the cluster - even briefly! Nodes will spam their own
localhost
trying to contact that other node that advertised localhost. CPU and network usage will be extremely high, but things might still be able to limp along depending on other factors. So basically you end up with a crippled cluster in a difficult to diagnose way.We could add better heuristics for advertising localhost... like only disallow it if
boostrap_expect>1
. But then things just get even more magical and complicated. I'd prefer to just force everyone not in dev mode to advertise a real address! :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but the configuration explicitly enabled dev mode in this case, so ... I guess it's OK to advertise 127.0.0.1 here?
I'm going to add another test to specifically check that 127.0.0.1 is NOT advertised except if dev mode is enabled or if it has been explicitly configured to do so, but could I make this particular test above clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: dev mode, yes, that sounds good and is a sane approach.