Ir al contenido

Executor Never Shut Down (ARCH8040)

Esta página aún no está disponible en tu idioma.

Key kotlin.async.executor-never-shut-down · Severity warning · Category async

Flags an ExecutorService created with Executors.newXxx that is never shut down - its threads keep the JVM alive.

val pool = Executors.newFixedThreadPool(4)
val pool = Executors.newFixedThreadPool(4)
try { work(pool) } finally { pool.shutdown() }

Shut the executor down in finally / close(), or use a coroutine dispatcher with structured scope.