Removing try/catch in the lock file acquiring algo, to avoid hanging like in case described here - https://devnet.jetbrains.com/message/5561306

it should now fail and fallback to in-process compilation
This commit is contained in:
Ilya Chernikov
2015-10-25 18:40:40 +01:00
parent 2fa0988c85
commit 80fb9b8473
@@ -402,12 +402,9 @@ public object KotlinCompilerClient {
val maxAttempts = COMPILE_DAEMON_STARTUP_LOCK_TIMEOUT_MS / COMPILE_DAEMON_STARTUP_LOCK_TIMEOUT_CHECK_MS + 1
var attempt = 0L
while (true) {
try {
if (lockFile.createNewFile()) break
// attempt to delete if file is orphaned
if (lockFile.delete() && lockFile.createNewFile()) break
}
catch (e: IOException) {} // Ignoring it - assuming it is another client process owning it
if (lockFile.createNewFile()) break
// attempt to delete if file is orphaned
if (lockFile.delete() && lockFile.createNewFile()) break
if (lockFile.exists() && ++attempt >= maxAttempts)
throw IOException("Timeout waiting the release of the lock file '${lockFile.absolutePath}")
Thread.sleep(COMPILE_DAEMON_STARTUP_LOCK_TIMEOUT_CHECK_MS)