You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Hugi Thordarson <hu...@karlmenn.is> on 2017/11/27 12:37:01 UTC

Experiencing occasional Cayenne-slowness on Sierra or High Sierra? Might want to read this.

Hi all.
Just a quick service notification: I recently noticed my unit tests were running rather slowly, due to weird occasional 8 second breaks.

Turns out that something changed in Sierra regarding how it handles host name lookups (although weirdly enough, this was only exposed in High Sierra for me) making the invocation of java.net.InetAddress.getLocalHost() extremely slow. And Cayenne uses that method in IDUtil to get the machine's IP address for generation of random IDs.

The workaround/fix is to add the hostname of your machine to the localhost records in /etc/hosts, as specified here:

https://thoeni.io/post/macos-sierra-java/

Cheers,
- hugi