From 775eeb75c92eb59132fc98278418a60d35a95b98 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 15 Dec 2017 11:56:11 +0100 Subject: [PATCH] Treat daemon startup timeout/error exceptions the same way as RMI errors will result on regular retry cycle on them, hopefully eliminating or reducing appropriate exception reports --- .../jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt index 18603ad9538..c93e88f212c 100644 --- a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt +++ b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt @@ -319,6 +319,7 @@ object KotlinCompilerClient { catch (e: ConnectException) { null to e } catch (e: ConnectIOException) { null to e } catch (e: UnmarshalException) { null to e } + catch (e: RuntimeException) { null to e } if (res != null) return res @@ -420,9 +421,9 @@ object KotlinCompilerClient { if (daemonOptions.runFilesPath.isNotEmpty()) { val succeeded = isEchoRead.tryAcquire(daemonStartupTimeout, TimeUnit.MILLISECONDS) if (!isProcessAlive(daemon)) - throw Exception("Daemon terminated unexpectedly with error code: ${daemon.exitValue()}") + throw RuntimeException("Daemon terminated unexpectedly with error code: ${daemon.exitValue()}") if (!succeeded) - throw Exception("Unable to get response from daemon in $daemonStartupTimeout ms") + throw RuntimeException("Unable to get response from daemon in $daemonStartupTimeout ms") } else // without startEcho defined waiting for max timeout