Refactor daemon periodic check and shutdown logic

Cleaner logic and logging, improved stability during shutdown, reduced
overhead of the periodic checks, and regular calls, should also eliminate
dying daemons scenario on parallel execution (another attempt to do it).
This commit is contained in:
Ilya Chernikov
2017-06-23 19:00:23 +02:00
parent 2c35675fd6
commit 8542e878f7
3 changed files with 173 additions and 130 deletions
@@ -335,7 +335,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
logFile.assertLogContainsSequence("Some sessions are active, waiting for them to finish")
val res = daemon?.getUsedMemory()
val res = daemon?.leaseCompileSession(null)
assertEquals("Invalid state", CompileService.CallResult.Dying(), res)
@@ -343,7 +343,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
Thread.sleep(100) // allow after session timed action to run
logFile.assertLogContainsSequence("All sessions finished, shutting down",
logFile.assertLogContainsSequence("All sessions finished",
"Shutdown started")
}
}