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

Remove usage of `InetAddress#getLocalHost` #12959

Merged
merged 1 commit into from Aug 18, 2015

Conversation

Projects
None yet
4 participants
@s1monw
Contributor

s1monw commented Aug 18, 2015

this method is very confusing and if it's used it's likely the wrong thing
with respect to the actual bound / published address. This change discourages
it's use and removes all useage. It's replaced with the actual published address
most of the time.

This can cause very confusing output for instance from http://localhost:9200/_cat/shards

index shard prirep state   docs  store ip            node    
foo   1     r      STARTED    5  5.5kb 192.168.2.123 Jester  
foo   1     p      STARTED    5 10.7kb 192.168.2.123 Sunfire 
foo   4     p      STARTED    4  8.1kb 192.168.2.123 Jester  
foo   4     r      STARTED    4 10.6kb 192.168.2.123 Sunfire 
foo   2     p      STARTED    9 10.9kb 192.168.2.123 Jester  
foo   2     r      STARTED    9 13.5kb 192.168.2.123 Sunfire 
foo   3     r      STARTED    7 15.9kb 192.168.2.123 Jester  
foo   3     p      STARTED    7 15.9kb 192.168.2.123 Sunfire 
foo   0     p      STARTED    5 13.3kb 192.168.2.123 Jester  
foo   0     r      STARTED    5 10.7kb 192.168.2.123 Sunfire 

it show 192.168.2.123 which is simply wrong here we bound to 127.0.0.1 and published on 127.0.0.1 as well.

@rmuir

This comment has been minimized.

Show comment
Hide comment
@rmuir

rmuir Aug 18, 2015

Contributor

awesome, +1, thank you for cleaning this up and removing the confusion

Contributor

rmuir commented Aug 18, 2015

awesome, +1, thank you for cleaning this up and removing the confusion

Remove usage or `InetAddress#getLocalHost`
this method is very confusing and if it's used it's likely the wrong thing
with respect to the actual bound / published address. This change discourages
it's use and removes all useage. It's replaced with the actual published address
most of the time.

@s1monw s1monw merged commit 1e511ed into elastic:master Aug 18, 2015

1 check passed

CLA Commit author is a member of Elasticsearch
Details

@s1monw s1monw deleted the s1monw:dont_use_getLocalHost branch Aug 18, 2015

@clintongormley clintongormley changed the title from Remove usage or `InetAddress#getLocalHost` to Remove usage of `InetAddress#getLocalHost` Aug 18, 2015

@jpountz jpountz added v2.0.0-beta1 and removed v2.0.0 v2.1.0 labels Aug 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment