JDK-8170910: Avoid 5 second localhost lookup behavior on OSX

Nora Howard nhoward at twitter.com
Wed Apr 3 16:41:31 UTC 2019


David and Alan, thanks for directing me to move the discussion to net-dev.
I'll do that.

On Wed, Apr 3, 2019 at 12:39 AM Alan Bateman <Alan.Bateman at oracle.com>
wrote:

> On 02/04/2019 23:35, Nora Howard wrote:
> > On OSX 10.12 or later, when no mDNS services are registered, getaddrinfo
> > fails on looking up localhost addresses[1]. The jdk’s current
> > implementation falls back to getifaddrs after getaddrinfo fails[2]. When
> > getaddrinfo fails in this way, it takes 5 seconds to fail [3]. This means
> > that calls to InetAddress.getLocalHost() may take up to 5 seconds to run.
> >
> > I’d like to change the jdk’s behavior in this instance so that instead of
> > falling back to calling getifaddrs after getaddrinfo fails, it instead
> > calls getifaddrs first if we’re on OSX and the hostname is localhost’s.
> >
> Can you bring this to net-dev to discussion? You will probably need to
> provide a lot of information on the environment where this occurs and
> also be prepared to do testing on lots of different configurations to
> make sure that there aren't any regressions.
>
> -Alan
>


-- 
Nora


More information about the jdk-dev mailing list