GitHub user ahgittin opened a pull request:

    https://github.com/apache/brooklyn-server/pull/768

    Improve localhost detection and webserver binding

    Fixes two annoying network issues:
    
    * Sometimes when disconnected Brooklyn detects a non-usable NIC address as 
localhost and things like SSH fail subsequently
    * If start-use-stop-immediately_restart brooklyn, it will normally take a 
different port eg 8082 because the first one eg 8081 will be in `TIME_WAIT` 
state.  Allow webserver to `REUSE_ADDR` so it takes the same port in this case. 
 Minor but hits me a lot when I'm testing!

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/brooklyn-server improve-localhost

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/768.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #768
    
----
commit 9f371e62e6dea55a2f844689bb9c53cadd49fea0
Author: Alex Heneveld <[email protected]>
Date:   2017-07-19T09:27:36Z

    improve how we find localhost
    
    increasingly i'm getting unusable NICs preferred by the method we used to 
use,
    InetAddress.getLocalhost(), and comments elsewhere eg 
https://stackoverflow.com/questions/5813194/inetaddress-getlocalhost-does-not-return-expected-ip-address-from-c-windows-s
    suggest that wasn't a good method in any case
    
    update most places to require a _reachable_ localhost address

commit b2e33f60be1048afef463c718bcc2fca9a724e29
Author: Alex Heneveld <[email protected]>
Date:   2017-07-19T09:37:56Z

    make BrooklynWebServer return usable address if bound to all NICs and NICs 
change

commit d57954745ae0eee96f320ffc1b75bf4b28a82f77
Author: Alex Heneveld <[email protected]>
Date:   2017-07-19T11:54:26Z

    prefer IPv4 addresses for localhost (this is what people seem to expect)

commit dcb61a7a05507c09eb63e3ab597546110c7ee43d
Author: Alex Heneveld <[email protected]>
Date:   2017-07-19T12:00:34Z

    let brooklyn bind with reuse_addr
    
    means starting, stopping, starting will pick up same address;
    doesn't go to 8082 just because previous instance in TIME_WAIT state

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to