Commit bfaf0245 authored by Mygod's avatar Mygod

Suppress SIGKILL errors

parent 6a2ac45e
...@@ -73,9 +73,12 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C ...@@ -73,9 +73,12 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
val startTime = SystemClock.elapsedRealtime() val startTime = SystemClock.elapsedRealtime()
val exitCode = exitChannel.receive() val exitCode = exitChannel.receive()
running = false running = false
if (SystemClock.elapsedRealtime() - startTime < 1000) { when {
throw IOException("$cmdName exits too fast (exit code: $exitCode)") SystemClock.elapsedRealtime() - startTime < 1000 -> throw IOException(
} else Crashlytics.logException(IOException("$cmdName unexpectedly exits with code $exitCode")) "$cmdName exits too fast (exit code: $exitCode)")
exitCode == 128 + OsConstants.SIGKILL -> Crashlytics.log(Log.WARN, TAG, "$cmdName was killed")
else -> Crashlytics.logException(IOException("$cmdName unexpectedly exits with code $exitCode"))
}
Crashlytics.log(Log.DEBUG, TAG, Crashlytics.log(Log.DEBUG, TAG,
"restart process: ${Commandline.toString(cmd)} (last exit code: $exitCode)") "restart process: ${Commandline.toString(cmd)} (last exit code: $exitCode)")
start() start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment