Speed up daemon startup when DNS timeouts

#KT-16917 fixed

The daemon code contained the following code:
```
ManagementFactory.getRuntimeMXBean().name
```

As it turns out `RuntimeImpl#getName` calls `VMManagementImpl#getVmId`,
which in turn calls `InetAddress.getLocalHost().getHostName()`.

`InetAddress.getLocalHost()` tries to resolve by making a DNS-request.
In case of a DNS-problem or a network misconfiguration,
resolving localhost can be very slow,
so a daemon client can disconnect
by the timeout (10 seconds) and fallback to the non-daemon compilation.

This change removes the call `getRuntimeMXBean().name`
(it is only used for logs).
This commit is contained in:
Alexey Tsvetkov
2017-03-17 15:08:34 +03:00
parent da24a99b91
commit c5324fcc50
@@ -94,7 +94,6 @@ object KotlinCompileDaemon {
log.info("Kotlin compiler daemon version " + (loadVersionFromResource() ?: "<unknown>"))
log.info("daemon JVM args: " + ManagementFactory.getRuntimeMXBean().inputArguments.joinToString(" "))
log.info("daemon args: " + args.joinToString(" "))
log.info("daemon process name: " + ManagementFactory.getRuntimeMXBean().name)
setIdeaIoUseFallback()