I have seen slow local network connections from Java on other platforms, 
but with H2 it seems to be OSX or mac OS users who are running into it.
Similar problems have been discussed here last month: H2 database running 
really slow on mac OS sierra 
https://groups.google.com/d/msg/h2-database/H-oSOO7Lwn4/Pm5eY0WTBwAJ   
Although the problem got resolved by a simple addition to the hosts file, 
it is not quite clear what were all the things at play there and whether 
your situation is the same.

In your case, you may want to first try to set the local host name 
explicitly to something simple (no spaces, apostrophes or other 
non-traditional characters), rather than relying on your system to somehow 
automatically convert computer name to a legal network hostname. (The full 
computer name can be kept as is, for use in the UI).

I am not sure why you try to add "-2" at the end of the presumed hostname 
in your hosts file, the queries in your TCP captures do not show anything 
like that.

Finally, if you had no luck seeing any effect from modifications to 
/etc/hosts: on newer macs the file is apparently shadowed by 
/private/etc/hosts

Regards,
Tomas


On Monday, December 19, 2016 at 2:59:57 PM UTC-5, SkiAddict wrote:
>
> On Monday, 19 December 2016 19:04:39 UTC+13, Noel Grandin wrote:
>>
>> ok, so it's hanging in the 
>>      at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
>>     at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
>>     at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:
>> 1323)
>>     at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
>>     - locked <0x0000000795802000> (a java.lang.Object)
>>     at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:271)
>>     - locked <0x00000007957ff450> (a java.lang.Class for org.h2.util.
>> NetUtils)
>>     at org.h2.server.TcpServer.getURL(TcpServer.java:198)
>>     at org.h2.tools.Server.start(Server.java:485)
>>     at org.h2.tools.Console.runTool(Console.java:265)
>>     at org.h2.tools.Console.main(Console.java:99)
>>
>> part.
>>
>> ​Some googling around doesn't find anything particularly interesting 
>> other than this:
>>    
>> http://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds
>>    
>> http://www.markhneedham.com/blog/2015/03/29/inetaddressimpllookupallhostaddr-slowhangs
>>
>> Do either of those help?
>>
>  
>
> Yes, and no.
>
> *No* in the sense that simply editing etc/hosts didn't help (even after a 
> restart).  I found https://github.com/thoeni/inetTester and ran the 
> binary; interestingly, although my etc/hosts now reads like this:
>
> 127.0.0.1    localhost santas-macbook-pro-2.local
> 255.255.255.255    broadcasthost
> ::1             localhost santas-macbook-pro-2.local
> fe80::1%lo0    localhost
>
> the result is
>
> Method called, hostname Santa's MacBook Pro.local, elapsed time: 5150 (ms)
>
> (notice the capitalisation *and* the lack of a "2" at the end)  I am 
> wondering I'm suffering some sort of caching problem, so will step through 
> the source today and see what I can see.
>
>
> *Yes* in the sense that this is now in Java territory (albeit stuff I've 
> never mucked with before) so I may be able to get the rest of the way on my 
> own.
>
>
> I'll keep you posted, and thank you so much for getting me this far!!
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to