mirror of https://github.com/sbt/sbt.git
[2.x] fix: Cleanup child processes on sbt exit (#8532)
When using fork := true, sbt spawns child processes that may become stale if cancelled. Previously, these processes were not cleaned up when running the exit command. This fix adds RunningProcesses.killAll() to the shutdown hook so that all tracked forked processes are terminated when sbt exits. Fixes #7468
This commit is contained in:
parent
1ed08f0034
commit
b58c0fb37f
|
|
@ -29,7 +29,7 @@ import sbt.internal.server.{ BuildServerProtocol, NetworkChannel }
|
|||
import sbt.internal.util.Terminal.hasConsole
|
||||
import sbt.internal.util.Types.{ const, idFun }
|
||||
import sbt.internal.util.complete.Parser
|
||||
import sbt.internal.util.{ Terminal as ITerminal, * }
|
||||
import sbt.internal.util.{ RunningProcesses, Terminal as ITerminal, * }
|
||||
import sbt.io.*
|
||||
import sbt.io.syntax.*
|
||||
import sbt.util.{ Level, Logger, Show }
|
||||
|
|
@ -221,6 +221,7 @@ object StandardMain {
|
|||
})
|
||||
|
||||
private val closeRunnable = () => {
|
||||
RunningProcesses.killAll()
|
||||
exchange.shutdown()
|
||||
pool.foreach(_.shutdownNow())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue