You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System Type & Version: MacOS 11.5.2 Big Sur
Description
During liquibase startup, the call database.getDefaultSchemaName(); in liquibase.changelog.ChangeLogParameters.java:61 leads to resolving the current hostname by liquibase.util.NetUtil.getLocalHostName in NetUtil.java:71. The subsequent line 75 takes 30s to resolve the hostname for the IP given by line 73. Interestingly, line 73 doesn't return 127.0.0.1 (from network interface eth0) but another IP taken from another network interface (eth1 / company internal network IP, here '/192.168.254.80' - yes starting with the slash. This IP can't resolved as fast as normally done by java vm.
liquibase.util.NetUtil.getLocalHostName()
InetAddresslocalhost = getLocalHost(); // => '/192.168.254.80' ... yes with the leading slashif (localhost != null) {
returnlocalhost.getHostName(); // needs 30s
}
Expected/Desired Behavior
Same as normal JVM resolution, tested by the follwing:
- Use default localhost finder for MacOs
- Removed specific check for windows/mac in NetUtil in favor of a more generic check for whether a loopback or local address got returned before falling back to iterating over interfaces
- Cached the found network interface to avoid future lookups
Co-authored-by: Nathan Voxland <nathan@voxland.net>
Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
Environment
Liquibase Version: 4.3.5
Liquibase Integration & Version: maven
Liquibase Extension(s) & Version:
Database Vendor & Version:
Operating System Type & Version: MacOS 11.5.2 Big Sur
Description
During liquibase startup, the call
database.getDefaultSchemaName();
inliquibase.changelog.ChangeLogParameters.java:61
leads to resolving the current hostname byliquibase.util.NetUtil.getLocalHostName
inNetUtil.java:71
. The subsequent line 75 takes 30s to resolve the hostname for the IP given by line 73. Interestingly, line 73 doesn't return 127.0.0.1 (from network interface eth0) but another IP taken from another network interface (eth1 / company internal network IP, here '/192.168.254.80' - yes starting with the slash. This IP can't resolved as fast as normally done by java vm.liquibase.util.NetUtil.getLocalHostName()
Expected/Desired Behavior
Same as normal JVM resolution, tested by the follwing:
Additional Context
There are solution on Stackoverflow for the general host resolving problem in JVM. ( https://stackoverflow.com/questions/39636792/jvm-takes-a-long-time-to-resolve-ip-address-for-localhost/39698914#39698914 ) But the solutiuons given there didn't work.
The text was updated successfully, but these errors were encountered: